Code4HR / local-art-api

Public Art Installations in Norfolk, VA
https://localartapi-code4hr.rhcloud.com/
GNU Affero General Public License v3.0
4 stars 4 forks source link

Implement ImageMagick or similar on server to create image thumbnails #24

Open wbprice opened 9 years ago

wbprice commented 9 years ago

https://www.npmjs.com/package/gm looks fairly mature. Provides a node interface to ImageMagick running on the server.

qwo commented 9 years ago

its a pretty standard lib to handle this. I wrote and tested some Code to upload to s3 but its also highlights compressing the images. it also shows how to upload locally to a directory.

if you add GM in there and preprocess before uploading or uploading a image_001.jpg and image_001_thumbnail.jpg that could work.

its written in an express route project but you can copy paste the logic into a happy route with no difference besides changes in the res/req object syntax. https://github.com/stanzheng/service-testing-ground/blob/master/app/routes/uploads.js

ghost commented 9 years ago

If we go about it this way, we could actually remove the imageurl part of the model, since that refers to an existing thumbnail and just use the fullimage as either an image element or something of that nature which points to the image host we have.