PHP-Scanner-Server icon indicating copy to clipboard operation
PHP-Scanner-Server copied to clipboard

request : resize image on client side

Open avilleret opened this issue 10 years ago • 4 comments

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.

avilleret avatar Jul 23 '14 13:07 avilleret

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 avatar Jul 23 '14 13:07 GM-Script-Writer-62850

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

GM-Script-Writer-62850 avatar Jul 23 '14 13:07 GM-Script-Writer-62850

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 :-)

avilleret avatar Oct 15 '14 14:10 avilleret

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

GM-Script-Writer-62850 avatar Oct 15 '14 14:10 GM-Script-Writer-62850