GM-Script-Writer-62850 / PHP-Scanner-Server

Allows you to use your Linux install as a web based scanner server thus allowing you to scan with any web enabled device; Now supports server side printing! (As of 1.4.11)
59 stars 17 forks source link

Make --format=pnm/tiff configurable #23

Closed tomasol closed 9 years ago

tomasol commented 9 years ago

For some reason imagemagick fails to convert my pnm files. When I change --format to tiff, everything works as expected. It would be great to have this as a setting.

GM-Script-Writer-62850 commented 9 years ago

you can change it on line 1228 of index.php which OS and version of imagemagick/scanimage do you have?

tomasol commented 9 years ago

I edited the index.php (made the extension into a variable) and it works for me. Just thought it could be useful for others. My imagemagick version is 6.7.7-10, scanimage (sane-backends) 1.0.22; backend version 1.0.22 .

GM-Script-Writer-62850 commented 9 years ago

can you scan a blank page in pnm format from your command line and upload it?, i want to see if i can figure out why pnm is not working for you, eg scanner specific or a software bug also your scanners help data would be nice if i add it i'm not sure if i want to make a a admin config option (config.ini) or put it in the UI

tomasol commented 9 years ago

scanimage -d 'hpaio:/usb/HP_LaserJet_Professional_M1132_MFP?serial=000000000QH85MQNPR1a' --source 'Flatbed' -l 0 -t 0 -x 215.9 -y 381 --resolution 75 --mode 'Color' --format=pnm > 'blank.pnm'

blank pnm

I had to rename the file extension to .png so that I could attach it here..

GM-Script-Writer-62850 commented 9 years ago

why is the extension png? clearly not a png and is pnm but i am not able to convert it either which OS are you running the server on?

tomasol commented 9 years ago

I renamed the file to '.png', otherwise I could not attach it here to the issue. Github allows attaching only files with following extensions:png,gif,jpg. But the file itself is what was produced by the command above. I am running on raspberry pi: pi@laserjet ~ $ uname -a Linux laserjet 3.18.11+ #781 PREEMPT Tue Apr 21 18:02:18 BST 2015 armv6l GNU/Linux pi@laserjet ~ $ cat /etc/issue Raspbian GNU/Linux 7

GM-Script-Writer-62850 commented 9 years ago

well that is odd i know i have used this on a raspberry pi model B id guess this issue is scanner specific i cant test it right now with my pi, kind of out of usb ports and last i checked networked scanning was extremely unstable since i will assume this is scanner specific i'll add it to the GUI this weekend

GM-Script-Writer-62850 commented 9 years ago

what do you think about me adding this to config.ini?

RawScanFormat   = 'pnm' ;   Defines default raw scan format (pnm or tiff)
ShowRawFormat   = false ;   Show GUI option to change raw format
tomasol commented 9 years ago

Hi I think it is good. Thanks.

GM-Script-Writer-62850 commented 9 years ago

By any change you would not happen to have a alternate scanner you to test, i think this is probably scanner specific, but this settings is a basic one for scanimage

that said, here are the changes i made

tomasol commented 9 years ago

Thanks for the fix