Posted: Fri 03 Nov 2017, 12:20
No reply after two days?
READ-ONLY Archive
https://oldforum.puppylinux.com/
You just guessed! Epson Stylus CX5400 printer-scanner works making this:rcrsn51 wrote:I am going to guess that your friend has an old Epson scanner. See the main post on page 1 for special instructions about Epson.
... and using PeasyScan 2.7/2.12 because it was already working using xsane without making any changes.rcrsn51 wrote:Open the file /etc/sane.d/dll.conf. Uncomment the line "epson" by removing the # symbol. Then comment out "epson2" by adding a #.
Yes indeed! If the program ends not properly for any reason, the image will not be deleted and may cause problem with a small nearly full pupsave: so Just for my own curiosity, why /root/scan (by default)?rcrsn51 wrote:Peasyscan generates some large, temporary PNM image files in /root. They are deleted when the program terminates. Maybe they should be placed elsewhere.
OK! Thanks.rcrsn51 wrote:That was the original program in 2010. Now the large pnm file is stored in /tmp. Only the final png file is stored in /root after you save it.
Code: Select all
ls: cannot access /usr/share/tessdata/*.traineddata: No such file or directory
pnmtotiff: computing colormap...
pnmtotiff: Too many colors - proceeding to write a 24-bit RGB file.
pnmtotiff: If you want an 8-bit palette file, try doing a 'pnmquant 256'.
Error opening data file /usr/share/tesseract-ocr/tessdata/.traineddata.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language '.traineddata'
Tesseract couldn't load any languages!
Code: Select all
LANGUAGE=$(basename $(ls -1 /usr/share/tessdata/*.traineddata | head -n1) .traineddata)
Code: Select all
LANGUAGE=$(basename $(ls -1 /usr/share/tesseract-ocr/tessdata/*.traineddata | head -n1) .traineddata)
Where did you get your "tessdata" package? On page 1, I have given the instruction:Argolance wrote:- Scanning image for OCR, I noticed that PeasyScan is searching for the "tessdata" directory inside /usr/share/ while it is (usually?) inside /usr/share/tesseract-ocr/. So the conversion into text is not done.
3. Copy the file xxx.traineddata to /usr/share/tessdata
Try this: Between lines 114 and 115, insertSmall suggestion: would it be possible to display the text file using the defaulttextviewer at the end of the OCR process as well as the pdf file using the defaultpdtviewer. I think it is what user is expecting for, instead of the image which is not really welcome in this case?
Code: Select all
defaulttexteditor "$SAVEFILENAME"
I simply installed Tesseract and all its needed dependancies from the PPM...rcrsn51 wrote:Where did you get your "tessdata" package? On page 1, I have given the instruction:3. Copy the file xxx.traineddata to /usr/share/tessdata
It is what I did for my own use, as well as for PDF file: with some minor changes, it works quite well.Try this: Between lines 114 and 115, insertCode: Select all
defaulttexteditor "$SAVEFILENAME"
When I installed Tesseract, as it is the case for all the PPM users, Puppy didn't ask me where to copy the tessdata folder and put it inside the /usr/share/tesseract-ocr directory, which seems to be the default/usual one. In any case, I think it may be appropriate your script to take this into account and search for this directory too?rcrsn51 wrote:When I added OCR to PeasyScan in 2010, I included my own Tesseract 3.00 package. It's still on page 1. Its default location is /usr/share/tessdata, so PeasyScan is written to look there.
.If you get a Tesseract package elsewhere, I can't predict where the language files will be located. So you need to provide the link into /usr/share/tessdata
Your script, as always, is very interesting, as simple and efficient as possible... but looks a bit tough for my taste!I agree that the phrases are confusing. The original versions of PeasyScan only saved to graphics files, so they made sense then.
See the pictures below, this is the choices I made...How about "Select the output format" and "Name the output file as"?
Code: Select all
# peasyscan
tiff2pdf: invalid option -- 'F'
LIBTIFF, Version 4.0.8
...
-f: set PDF "Fit Window" user preference
...
tiff2pdf: invalid option -- 'F'
LIBTIFF, Version 4.0.8
Thanks. The developers of libtiff are always changing something.charlie6 wrote:editing /usr/local/bin/peasyscanCode: Select all
# peasyscan tiff2pdf: invalid option -- 'F' LIBTIFF, Version 4.0.8 ... -f: set PDF "Fit Window" user preference ... tiff2pdf: invalid option -- 'F' LIBTIFF, Version 4.0.8
and replacing -F by -f after the two instances of tiff2pdf fixes the issues.
Got the URI="pixma:04A91714_F30F67" by typing in terminal:export URI="pixma:04A91714_F30F67"
export SOURCE="flatbed"
export MODE="lineart"
export RESOLUTION="300"
export PAPER="A4"
export LANGUAGE="fra"
export OTHER="--custom-gamma=yes --gamma-table [0]1-[4095]255 --gamma=0.4"
or better, which reports all available scanimages options for the current scanner# scanimage -h
--gamma=0.4 : values less than 1 increase the contrast# scanimage -A
All options specific to device `pixma:04A91714_F30F67':
Scan mode:
--resolution auto||75|150|300|600dpi [75]
Sets the resolution of the scanned image.
--mode auto|Color|Gray|Lineart [Color]
Selects the scan mode (e.g., lineart, monochrome, or color).
--source Flatbed [Flatbed]
Selects the scan source (such as a document-feeder). Set source before
mode and resolution. Resets mode and resolution to auto values.
--button-controlled[=(yes|no)] [no]
When enabled, scan process will not start immediately. To proceed,
press "SCAN" button (for MP150) or "COLOR" button (for other models).
To cancel, press "GRAY" button.
Gamma:
--custom-gamma[=(auto|yes|no)] [yes]
Determines whether a builtin or a custom gamma-table should be used.
--gamma-table auto|0..255,...
Gamma-correction table. In color mode this option equally affects the
red, green, and blue channels simultaneously (i.e., it is an intensity
gamma table).
--gamma auto|0.299988..5 [2.2]
Changes intensity of midtones
Geometry:
-l auto|0..216.069mm [0]
Top-left x position of scan area.
-t auto|0..297.011mm [0]
Top-left y position of scan area.
-x auto|0..216.069mm [216.069]
Width of scan-area.
-y auto|0..297.011mm [297.011]
Height of scan-area.
Buttons:
--button-update
Update button state
--button-1 <int> [0] [read-only]
Button 1
--button-2 <int> [0] [read-only]
Button 2
--original <int> [0] [read-only]
Type of original to scan
--target <int> [0] [read-only]
Target operation type
--scan-resolution <int> [0] [read-only]
Scan resolution
Extras:
--threshold auto|0..100% (in steps of 1) [inactive]
Select minimum-brightness to get a white point
--threshold-curve auto|0..127 (in steps of 1) [inactive]
Dynamic threshold curve, from light to dark, normally 50-65
#
To mention: the above scanner-specific-options "Extras:" would be specific to the MODE="Color", and then inactive if MODE=lineart, which I did not have needed to investigate till now.# scanimage --mode Gray --custom-gamma=yes --gamma-table [0]0-[99999]255 >image.pnm
scanimage: option --gamma-table: index 99999 out of range [0..4095]