jazzhistorydatabase / jhdb-cms

Content management system for jazzhistorydatabase.com
3 stars 0 forks source link

Optimize images for web before publishing #106

Closed matticoli closed 4 years ago

matticoli commented 4 years ago

Reference: https://ahmadawais.com/resize-optimize-images-javascript-node/

We should generate a thumbnail (<500px max dimension) and a full screen (<2k? max dimension, test this on a couple of screens) and put those into DBX and Firestore

(Note: they should be stored in a dedicated thumbnails dir, not in the user's folder as they may then select those thumbnails by accident when adding images to pages. The filenames can be noted by dbx id of original image)

drnek commented 4 years ago

We need to look at file processing and storage workflow altogether. When images are uploaded, they should be queued for server side processing where we: make 2 copies of the original image, keep the original image in a source folder, and then for each of the 2 copies they should either be in subfolders or have suffixes appended like _lg or _tn. 1st convert images to JPG, then scale the LG to 1800 or 2000px, then use image optimizer to reduce file size by 50-80% while keeping quality. for the TN scale them to 800px and run optimizer.

drnek commented 4 years ago

I changed the title of this bug to better reflect the issue. All images for web need to be processed, both on the page itself (TN) and in Lightbox (LG)