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

Command Line Error (No space after "--adf-mode" #37

Closed pjmsullivan closed 8 years ago

pjmsullivan commented 8 years ago

Hello and thanks for the great work! When I click "Scan Image" the command line output is missing a space after "--adf-mode Simplex" causing the scan to fail. Here is the command from the debug console:

www-data@192.168.1.10:/var/www/html/scanner$ cd /tmp/scandir0;scanimage -d 'epsonds:libusb:001:005' --source 'Automatic Document Feeder' -l 0 -t 0 -x 215.9 -y 279.4 --adf-mode Simplex--resolution 300 --mode 'Gray' --format=pnm --batch

Installed on raspberry pi debian jessie. Scanner is Epson Workforce DS-510 with new sane epsonds backend (had to compile that).

I can execute the command on the server with the space and the scan completes.

Thanks again friend.

GM-Script-Writer-62850 commented 8 years ago

Thank for the report, how I missed that I don't know, I know I tested it on my mom's printer and i know I have used it a couple times in the last few months for her.

pjmsullivan commented 8 years ago

$cmd="scanimage -d $DEVICE $OURCE-l $X -t $Y -x $SIZE_X -y $SIZE_Y $DUPLEX--resolution $QUALITY --mode ".shell($MODE)." $LAMP--format=$RAW"; This is like reading another language to me, but could that line (1263) be the source of the problem?

GM-Script-Writer-62850 commented 8 years ago

It can be fixed in multiple places, i chose to put the space in the $DUPLEX variable (Line 1247) as this variable can be empty at times and a double space looks unclean IMO

pjmsullivan commented 8 years ago

Okay - thanks again for the work. It's amazing the difference a space can make! Should I mark this as closed?

GM-Script-Writer-62850 commented 8 years ago

I was just looking at the code I wrote some more, does your scanner support double sided scanning via the doc feeder? Can you test double sided multi-page scanning? If i am reading it i made it so it is either one or the other but not both edit: Never mind, the command line options were making me misread it, double sided scanners that don't use a doc feeder and ones that do use a different option

GM-Script-Writer-62850 commented 8 years ago

Thanks again for the report, the code at the line you were looking at is a mesh of shell and php, it builds the shell command using php, that makes it hard to read if you don't know both languages. and you have to read lines 1246-1256 to know what the duplex variable is, to really understand it it you to look at line 15 then back trace that to the UI then probably in the the javascript (main.js) and back to lines index.php's 594 758 where the scanner options are detected and saved into the config file I'm sure that goes a bit far for your interest

if you find yourself scanning to plain text a lot and need more processing power you can setup a linux box or probably a windows 10 one and run the php scanner server there and have the pi handle the scanner i just made a wiki for doing that last weekend, https://github.com/GM-Script-Writer-62850/PHP-Scanner-Server/wiki/Adding-Remote-Scanners then you can have a powerful system do the text conversion and still have the pi run a print server

pjmsullivan commented 8 years ago

My scanner supports single-pass duplex on the doc feeder. I tested duplex and simplex through the adf. I tested a double-sided three page document (six pages total). Strangely, duplex scanned page 6 only. Simplex scanned pages 3 and 5.

Thanks for the walkthrough!

GM-Script-Writer-62850 commented 8 years ago

When scanning a multi-page doc it will show only the last page, but there is a link at the top that should show all pages via the Scanned Files page, This link will only show the files created between the start and stop time of the ADF's operation. It would be a good idea to have a way for it to only include images made by that scanner (note to self) Using a HP ADF scanner lacking a Duplex option, it scanned all pages

www-data@127.0.0.1:/home/www-data/php-scanner$ cd /tmp/scandir0;scanimage -d 'hpaio:/usb/Photosmart_C7200_series?serial=MY83IH436004YG' --source 'ADF' -l 0 -t 0 -x 215.9 -y 279.4 --resolution 75 --mode 'Lineart' --format=pnm --batch
Scanning -1 pages, incrementing by 1, numbering from 1
Scanning page 1
Scanned page 1. (scanner status = 5)
Scanning page 2
Scanned page 2. (scanner status = 5)
Scanning page 3
Scanned page 3. (scanner status = 5)
Scanning page 4
Scanned page 4. (scanner status = 5)
Scanning page 5
Scanned page 5. (scanner status = 5)
Scanning page 6
Scanned page 6. (scanner status = 5)
Scanning page 7
Scanned page 7. (scanner status = 5)
Scanning page 8
scanimage: sane_start: Document feeder out of documents
www-data@127.0.0.1:/home/www-data/php-scanner$ date +%z
-0400
www-data@127.0.0.1:/home/www-data/php-scanner$ echo "Warning, Guessing Time Zone:\n\tGuessed as GMT -4.\n\tdate.timezone is not set in your /etc/php5/apache2/php.ini file.\n\tIt is probably set on line 880.\n\tThere is also a override in /home/www-data/php-scanner/config.ini on line 11."
Warning, Guessing Time Zone:
    Guessed as GMT -4.
    date.timezone is not set in your /etc/php5/apache2/php.ini file.
    It is probably set on line 880.
    There is also a override in /home/www-data/php-scanner/config.ini on line 11.
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out1.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-29-38.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out1.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-29-38.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out2.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-29-54.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out2.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-29-54.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out3.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-30-10.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out3.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-30-10.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out4.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-30-26.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out4.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-30-26.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out5.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-30-42.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out5.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-30-42.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out6.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-30-59.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out6.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-30-59.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out7.pnm' -scale '450x471' 'scans/thumb/Preview_0_Jun_5_2016~10-31-14.jpg'
www-data@127.0.0.1:/home/www-data/php-scanner$ convert '/tmp/scandir0/out7.pnm' -alpha off 'scans/file/Scan_0_Jun_5_2016~10-31-14.png'
www-data@127.0.0.1:/home/www-data/php-scanner$ 

and thus the cat must investigate the scanner after it came to life and moved paper can you post the output of scanimage --help maybe it uses some odd parameter for adf stuff

pjmsullivan commented 8 years ago

Hi:

Sorry for the delayed response. You were right about my issue where ADF single pass duplexing wasn't working. It was a SANE issue, not a php-scanner-server issue and it took a long time for me to figure out what the problem was. I started on a fresh debian install and finally, today, I rebuilt the SANE source for the DLL and EPSONDS backends and duplexing works like a charm. Now I'll reinstall your great software and it's off to the scanning races!

Thanks again for your work.

Best, Patrick

GM-Script-Writer-62850 commented 8 years ago

Well that is good to hear, happy scanning