Feature #1128

Media Management

Added by Pavan Rikhi almost 2 years ago. Updated 3 days ago.

Status:NewStart date:08/18/2019
Priority:NormalDue date:
Assignee:Pavan Rikhi% Done:


Category:MediaSpent time:-
Target version:v0.7.0 - Misc Pages & UI
Easy Pickings:


The server should accept the largest versions of images, scaling & optimizing them at pre-defined resolutions. Then images can be returned as a map of widths to urls, or we can use a function to enforce proper client urls to the generated images.

Maybe just use this functionality for Product/Category images at first, instead of generalizing. Eventually there can be an admin page for managing uploaded media, supporting PDFs & other file types as well as allowing customization of filenames & titles w/ embed codes for adding the media to a page.


#1 Updated by Pavan Rikhi 8 months ago

  • Category changed from General to Media

#2 Updated by Pavan Rikhi 8 days ago

Instead of strings for images, send some object like:

[ { height: <int>, width: <int>, src: <path> }
, ...

And then use the srcset attribute when rendering the image. See if we need any other info for using srcset with images.

Do we store the image data in the database, poll the filesystem during requests, or keep a cache of the image data?

Check sizes necessary for each product & category image. List pages, details pages, cart pages, etc.

#3 Updated by Pavan Rikhi 8 days ago

Start an Images module in the server that handles resizing images to set heights or widths and then optimizing them. Have an ImageOptimizationConfig that has flags for which optimizers are available(optipng, jpegtran, gifsicle)(use executableAvailable to check existence). Hash the source images and append this to the file name, along w/ size info.

Use temp directory for processing, cleaning up afterwards.

Modify ImageMigration script so thumbnails are generated.

#4 Updated by Pavan Rikhi 3 days ago

  • Start date set to 08/18/2019

Also available in: Atom PDF