Closed vukomir closed 11 years ago
can you run
sudo -u apache scanimage -d "XeroxPhaser3100:usb:002:002" -l 0 -t 0 -x 210 -y 297 --resolution 75 --mode Halftone --format=ppm > "/tmp/scan.ppm"
to me it looks like the scan is exiting in error, if centos does not use sudo all you have to do is run the command as apache and we will get what we need
i run the command and didn't get any error on scan.
root@Merlin RC=0 /samba/public # sudo -u apache scanimage -d "XeroxPhaser3100:usb:002:002" -l 0 -t 0 -x 210 -y 297 --resolution 75 --mode Halftone --format=ppm > "/tmp/scan.ppm"
when i tray to convert the file in a jpg i get:
root@Merlin RC=0 /tmp # convert "/tmp/scan.ppm" -scale 450x471 "/tmp/Preview_0_Jul_24_2012~15-54-26.jpg"
convert: unable to read image data `/tmp/scan.ppm' @ pnm.c/ReadPNMImage/659.
convert: missing an image filename `/tmp/Preview_0_Jul_24_2012~15-54-26.jpg' @ convert.c/ConvertImageCommand/2800.
from what i can see the file if generated ok.
root@Merlin RC=1 /tmp # file /tmp/scan.ppm
/tmp/scan.ppm: Netpbm PBM "rawbits" image data
try this one
scanimage -d "XeroxPhaser3100:usb:002:002" -l 0 -t 0 -x 210 -y 297 --resolution 75 --mode Halftone --format=ppm > "/tmp/scan-test.ppm"
can you open scan-test.ppm with a image viewer?
what is the file size?
if it looks like th file size of a image what at the 1st 5 lines it shows in a text viewer (cat /path/to/file | less
)
Either you are getting a empty file or your version of scanimage is spitting output data at the top of the image file just thought of something IIRC Cent OS uses some really old software what version of imagemagick are you using i really don't know what the min version is on the dependencies (except imagemagick) simply because i never encountered old version oldest tested version:
user@lucid-desktop:~$ scanimage --version
scanimage (sane-backends) 1.0.20; backend version 1.0.20
chad@lucid-desktop:~$ convert --version
Version: ImageMagick 6.6.2-6 2010-12-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
user@lucid-desktop:~$
Does your imagemagick support ppm?
user@lucid-desktop:~$ identify -list format | grep PPM
PPM* PNM rw+ Portable pixmap format (color)
I don't know the permissions on Cent OS bunt on ubuntu apache is named www-data so if the permission are the same apache would have to be in the lp group assuming assuming both use a lp group with the same name but since it could detect the scanner that should not be the issue
Hi,
root@Merlin RC=0 /usr/local # scanimage --version
scanimage (sane-backends) 1.0.21; backend version 1.0.21
root@Merlin RC=0 /usr/local # convert --version
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
root@Merlin RC=0 /usr/local # identify -list format | grep PPM
PPM* PNM rw+ Portable pixmap format (color)
root@Merlin RC=0 /usr/local # ls -ld /samba/public/scan-test.ppm
-rw-r--r-- 1 root smb 67K Jul 26 10:53 /samba/public/scan-test.ppm
the ppm is ok, i can view the image. i will tray to update imagemagick with a new version to se if this will solve the problem.
Thanks for the support
When it was scanned with apache could you open the ppm (see post 2 for command) it is in the /tmp folder
the file is ok when i scan with apache user.
Then it is most likely the version on ImageMagick, know the one on Ubuntu 10.04 works but one feature does not work
Closing this in the assumption that the problem was a old unsupported version of imagemagick, due to lack of reply from vukomir, i really wish people would post back when they figured out a fix it really can help other people, why would you wish your problems on others?