I recently started using zola and found myself using shortcodes for automatic image downscaling.
After trying around a little bit, I found that using any
fit mode always resizes the image to the exact specified size of the respective dimension.
Since I only want to optimize my website for mobile usage, the upscaling of images was rather troubling than helpful, since the quality of automatically upscaled image was naturally poorer and looked really bad.
Because of this I thought that a new mode might be useful (
shrink_fit), which only resizes and fits to the specified dimensions, if the image is bigger than the specified sizes in any dimension.
I already applied the changes in my fork and I’m ready to open a PR, if you like the idea:
Otherwise feel free to criticize the idea or to suggest changes.