Scale images.


Image mummifiers need the ability to scale images if they are beyond some configurable threshold.

A user will likely want to dump a bunch of full-size, original images into the source tree without bothering to individually scale or otherwise manipulate them. But they probably don't want the full-size image being deployed to the size, primarily because of file size. Thus there needs to be some configurable threshold, probably based on file size, above which the image mummifier would automatically scale the image.




Garret Wilson
June 7, 2020, 9:11 PM

For configuration a threshold of 1MB sounds appealing.

The threshold configuration will probably go in the project mummy: section. As we already have pageNamesBare, it could be something like imageScaleThresholdSize and accept something like "1MB", although accepting a byte count 1000000 would be more direct semantically.

We should also revisit whether "page" and "image" artifacts get their on sections in the configuration; e.g.

One big question is whether Confound easily allows fallbacks for nested sections like this, if one of the sections is being used as a superconfiguration; for example added support for a mummy.turf file in the project directory that would act as if all its keys were prefexed by mummy. and would override the project file. We would need to make sure the mummy.turf file's image: section, for example, wouldn't override the entire image: section in the main project file, but instead allow individual properties within that section to be overridden if the entire path is given, e.g. mummy.image.scaleThresholdSize.

Garret Wilson
June 7, 2020, 9:12 PM

Note that image scaling via AWT was studied extensively and implemented in the old Marmot library. Check the image resource kit classes.

On a related note, we may want to have some sort of filtering pipeline like Marmot did, so we can add more transformations in the future.

An interesting thought is whether mummifiers in general might support filtering pipelines for content; they would be set up during the planning stage, and then invoked as streams rather than simple file copying. Maybe that's over-thinking things at this stage, but it could be very useful in the future for data pipelines. Maybe this general feature would work in a separate data pipeline mummifier.


Garret Wilson


Garret Wilson




Fix versions