Fax/Scan

gutiersa wrote on Tuesday, May 12, 2009:

HELP!

I would like to use the ‘scanner in’ feature of Fax/Scan in openemr, but when I try to dispatch a document I get:

convert returned 127:

If I click dispatch a second time for the same document, I get the dispatch window but the document is not visible.

Here is what I have in globals.php:

$GLOBALS[‘hylafax_server’]   = ‘/usr/local/bin’;
$GLOBALS[‘hylafax_basedir’]  = ‘/var/spool/hylafax’;
$GLOBALS[‘hylafax_enscript’] = ‘enscript -M Letter -B -e^ --margins=36:36:36:36’;

I have:

freebsd 7.1
openemr 3.0.1
apache 2.2
php5

aperezcrespo wrote on Tuesday, May 12, 2009:

Hi
Make sure your scanner is sending tiff files to scan_docs.

Thanks

gutiersa wrote on Tuesday, May 12, 2009:

thanks

it actually sends pdf files
is it possible to store as pdf files after scanning them as tiff?

aperezcrespo wrote on Tuesday, May 12, 2009:

Hi
  It will convert from tiff to pdf.  Also if moving a scanned document to the patient record, you should consider keeping your system free of clutter by selecting the delete option.  The same is true if you are faxing the document.

Thanks

gutiersa wrote on Tuesday, May 12, 2009:

ok im scanning tiff files but now I get:

tiffsplit returned 127:

aperezcrespo wrote on Tuesday, May 12, 2009:

Verify that apache can write to the documents directory, EDI and ERA as well.

gutiersa wrote on Wednesday, May 13, 2009:

yep, apache can write to all those folders

I think the problem is that the program files in my hylafax installation are in two different places:

/usr/local/bin and /var/spools/hylafax

also somehow I am not able to tell openemr where imagemagick is located. where is openemr expecting to find imagemagick program files? like tiffsplit?

I have done some googling and it appears imagemagick returns 127 when the paths are not correct.

thanks for the help!

aperezcrespo wrote on Wednesday, May 13, 2009:

Then check the path in globals.php
The default in globals.php is ‘/var/spool/fax’ not ‘/var/spools/hylafax’

cfapress wrote on Thursday, May 14, 2009:

Dr G,

Does Imagemagick work on the command line for you?

Jason

drbowen wrote on Thursday, May 14, 2009:

I am curious as well.  Joe Holzer’s experience with Imagemagick in Windows is that it either does not work at all or not well.  What image program should we use in the Windows environment?

If I recall Dr. G. runs a Windows Vista desktop and very likely does not have Imagemagick "on the command line" unless you mean on the "command line of her server".

In most distributions one does not need to tell the operating system "where the imagemagick program is installed."

In FreeBSD did you update the command list ( rehash ) after installation or Imagemagick?

Is "gd" compiled into the PHP?

Sam Bowen, MD

sunsetsystems wrote on Thursday, May 14, 2009:

I’m not a Windows guy, but I think the ImageMagick developers would dispute the notion that it does not work under Windows.  See www.imagemagick.org.  It may be that OpenEMR is just not finding it, and someone needs to troubleshoot the issue.

Also very important is that ImageMagick alone is not enough.  You’ll also need Tiff for Windows (see http://gnuwin32.sourceforge.net/packages/tiff.htm) and GhostScript for effective image processing in OpenEMR.  It would be great if someone would work on documentation for installing these and other dependencies.

Rod
www.sunsetsystems.com

drbowen wrote on Thursday, May 14, 2009:

I am curious as well.  Joe Holzer’s experience with Imagemagick in Windows is that it either does not work at all or not well.  What image program should we use in the Windows environment?

If I recall Dr. G. runs a Windows Vista desktop and very likely does not have Imagemagick "on the command line" unless you mean on the "command line of her server".

In most distributions one does not need to tell the operating system "where the imagemagick program is installed."

In FreeBSD did you update the command list ( rehash ) after installation or Imagemagick?

Is "gd" compiled into the PHP?

Sam Bowen, MD

gutiersa wrote on Thursday, May 14, 2009:

I used ImageMagick in the command line of my freebsd server once and it did work.
I believe I even installed it once in a windows xp computer.
Currently the Xwindows system in my freebsd server is not working and i dont know how to test imagemagick from the command line. Also I really was not planning on reinstalling xorg due to security issues in my server, as I have learned recently.

In FreeBSD did you update the command list ( rehash ) after installation or Imagemagick?
      probably not, dont know how to do this!

Is "gd" compiled into the PHP?
     I believe so: this is what phpinfo has to say:

gd
GD Support     enabled
GD Version     bundled (2.0.34 compatible)
FreeType Support     enabled
FreeType Linkage     with freetype
FreeType Version     2.3.7
T1Lib Support     enabled
GIF Read Support     enabled
GIF Create Support     enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support     enabled
XPM Support     enabled
XBM Support     enabled

It also says this under Imagick

imagick
imagick module    enabled
imagick module version     2.2.1
imagick classes     Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version     ImageMagick 6.5.1-10 2009-05-12 Q16 http://www.imagemagick.org
ImageMagick copyright     Copyright (C) 1999-2009 ImageMagick Studio LLC
ImageMagick release date     2009-05-12
ImageMagick Number of supported formats:     194
ImageMagick Supported formats     A, AI, ART, ARW, AVI, AVS, B, BGR, BIE, BMP, BMP2, BMP3, BRG, C, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DPS, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FPX, FRACTAL, FTS, G, G3, GBR, GIF, GIF87, GRADIENT, GRAY, GRB, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, JBG, JBIG, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RBG, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive    Local Value    Master Value
imagick.locale_fix    0    0

Would I need tiff for windows in an unix server?

I do have ghostscript 8 in my server!

gutiersa wrote on Thursday, May 14, 2009:

Actually imagemagick is working from the command line. Here is what I did:

I took a picture of my kids and entered the following command:

convert kids.jpg -font courier -fill white -pointsize 20 -annotate +50+50 ‘Kids’ kids_annotate1.jpg

and it actually worked. I was able to view the new image with the word Kids written in the upper left hand corner, from my windows vista laptop which is connected to the same network as the server.

gutiersa wrote on Thursday, May 14, 2009:

Rod:

Could my problem have something to do with the location of my openemr patient documents?
I am experiencing another ImageMagick problem when I try to print patient documents from the pt reports utility. The demographics, notes and so on get generated on the report without problem but for the documents I have selected I get this error message:

cannot be converted to JPEG. Perhaps ImageMagick is not installed?

I was reviewing the code and noticed this piece of code from custom_report.php?

                    if (is_file($to_file)) {
                        $to_url = $GLOBALS[‘webroot’] . “/documents/$pid/” . basename($to_file);
                        echo “<img src=’$to_url’><br><br>\n”;
                    } else {
                        echo "<b>NOTE</b>: " . xl(‘Document’) . “’” . $fname . "’ " .
                            xl(‘cannot be converted to JPEG. Perhaps ImageMagick is not installed?’) .

the problem is that my documents folder is not located inside openemr. I placed it in a folder named:

/var/OpenEMR/openemr/documents

hence the concatenation of $GLOBALS[‘webroot’] . “/documents/$pid/” would generate:

/openemr/documents/$pid

which in my case would not work, default to the else statement and generate the error I am getting?

I really appreciate your help. Image magick is working fine from my freebsd server command line.

sunsetsystems wrote on Friday, May 15, 2009:

$GLOBALS[‘webroot’] is a URL path, not a filesystem path.  I don’t think that is your problem.

Best bet is to figure out the exact command that custom_report.php was trying to execute (e.g. insert some debugging code to print it out), and then try that from the command line to see what error occurs.

Rod
www.sunsetsystems.com

cfapress wrote on Friday, May 15, 2009:

Dr G,

Can you see the converted images proper on the screen? Is this problem only when you try to print?

I see the code for print_custom_report.php is different from custom_report.php in the area that involves ImageMagick. Perhaps this is the trouble. If you’re able to see the images on the screen but not print then the code in the print_custom_report.php needs to be changed to match that in the custom_report.php file.

Jason

gutiersa wrote on Saturday, May 16, 2009:

no the converted images are not there the error message is there instead
Dr G