arvindr21 / blueimp-file-upload-expressjs

A simple express module for integrating jQuery File Upload.
http://expressjs-fileupload.cloudno.de/
104 stars 69 forks source link

image resize #5

Closed amobrem closed 9 years ago

amobrem commented 10 years ago

When will this be ready? Can you implement it with node-canvas?

Thanks

arvindr21 commented 10 years ago

@amobrem I am looking into a couple of options. The problem with Imagemagick and node-canvas is that they have additional dependencies as described here: https://github.com/LearnBoost/node-canvas/wiki/_pages.

And when you deploy your application to the server, you will need to do the same setup there and on most of the public hostings this may be an issue.

I am presently evaluating https://www.npmjs.org/package/image-resizer. Feel free to suggest.

Thanks, Arvind.

mycaule commented 10 years ago

As I mentionned in your blog, I find it annoying that the original file gets copied in thumbnails folder.

https://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing

The client code provides client-side image resizing support without Imagemagick or Cairo. I think the file is used by the client side script as a thumbnail while the file is in the "waiting room" before send button gets pushed.

Maybe we could just upload the thumbnail generated in the same time as the original file ?

arvindr21 commented 10 years ago

@mycaule let me give that a shot..

mycaule commented 10 years ago

http://stackoverflow.com/questions/2434458/image-resizing-client-side-with-javascript-before-upload-to-the-server With modern browsers, thanks to HTML5 <canvas> element it is possible to resize an image client-side.

arvindr21 commented 10 years ago

Yup, that is true. As of now the logic is to create the thumbnail on the server. I might need to tweak the server side code as well.

arvindr21 commented 10 years ago

@amobrem Added the thumbnail creation process with lwip.

mycaule commented 9 years ago

lwip has C++ dependencies...

From https://www.npmjs.com/package/lwip :

Note: Installation of this module involves compiling native code. If npm install lwip fails, you probably need to setup your system. See instructions. Building on Windows with Visual Studio requires version 2013 or higher.

arvindr21 commented 9 years ago

@mycaule True. But this seems to be the only sanest module out there! :/

mycaule commented 9 years ago

Have you looked at GraphicsMagick? It's a fork of ImageMagick and it claims to be "much smaller and tighter (3-5X smaller installation footprint)".

arvindr21 commented 9 years ago

Yeah, but the process to setup is very tedious. Its not very "npm-iy". So did not pick that. FYI : http://aheckmann.github.io/gm but you need to setup GraphicsMagick or ImageMagick on your machine first before you start using them in Nodejs.

mycaule commented 9 years ago

In Linux, the setup is just apt-get install graphicsmagick and 8MB of space. lwip needs the same space for the binaries it's building, but you need to have or setup a C++ dev environment before (especially on Windows machines).

I agree however that this is too much just to resize an image...