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

request : resize image on client side #19

Open avilleret opened 10 years ago

avilleret commented 10 years ago

would it be possible to let the client browser to resize image on the fly instead of doing that on the server ? i'm running this amazing scan server on a very small computer (ok it's a NAS), and it takes very long time to display the image after the scan finishes. So I guess it's a resizing issue.

GM-Script-Writer-62850 commented 10 years ago

i can resize a image via css (visually), but it will not alter the server's copy size. i doubt resizing it on the screen would help you. if you needed say more preview data like say a scaled pixel resolution instead of (or in addition to) a % increase that should be a simple matter

you could use gimp client side, just saying (at least till we find a solution)

When you say NAS you mean a synology like box or a custom desktop design in a Cooler Master elite 110 case

GM-Script-Writer-62850 commented 10 years ago

another option would be another computer with a better CPU (and/or more ram) and mount its scans folder on the NAS the scanner does support remote SANE scanners

avilleret commented 9 years ago

i can resize a image via css (visually), but it will not alter the server's copy size.

I was thinking about that exactly. Since I have lot's of disk space, the file size on server side doesn't matter. But it takes a while for small CPU to convert high resolution raw images from the scanner.

I saw there are at least two conversions : first to JPG and then a re-sizing to display it (as a thumbnail). Even if the first one is needed to display (but I don't know, maybe some browser can handle PPM files and do the conversion on client's side ?), the re-sizing can be made on client side. I think this can save a lot of server's CPU cycles.

In my case, the scanner was plugged on a customized Western Digital MyBookWorld Edition II. Today, I'm switching to a Raspberry Pi since my printer driver are now available for its arch. But Raspberry Pi is still a not-so-powerful computer to do high-res image conversion...

BTW this is just to save time and have a more responsive user experience. Anyhow thanks for this great tool :-)

GM-Script-Writer-62850 commented 9 years ago

i will point out you can OC the CPU on a rPi

Even if there is a way to resize/convert it it would be to be cross browser

IDK if this is feasible but the way i have my stuff set up is my printer/scanner is connected to my desktop which is usually on

there are other low power devices with more power than a pi has like the hummingboard-i2 and cpu/mobo combos

img to text is another cpu intensive process

you may be able to speed it up a tad by disabling http compression https://github.com/GM-Script-Writer-62850/PHP-Scanner-Server/blob/master/.htaccess#L17-20 you can remove these lines here

remember the rpi shares all its I/O operations with a usb 2.0 controller, so uploading uses sd/usb and the nic at the same time so the max speed is 1/2 usb 2.0 at best