spanezz / staticsite

Static site generator
GNU General Public License v3.0
45 stars 7 forks source link

Feature for image handling #39

Closed spanezz closed 4 years ago

spanezz commented 4 years ago

(from a conversation with @DonKult)

One could add an image feature that picks images from the content directory, scans EXIF tags for metadata, and depending on image sizes, generates scaled down versions and thumbnails.

One could also skip doing the scaling if the destination file already exists in the output directory and does not have an older mtime.

Finally, hook into the link rewriter, and when seing an <img> tag with a src to an image page, it can turn it into a <picture> tag instead, properly linking to a set of resolutions.

spanezz commented 4 years ago

Relevant link: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images

spanezz commented 4 years ago

PIL can do EXIF but only for JPG

spanezz commented 4 years ago

exiftool has a -json option, and can read data from many, many file types

spanezz commented 4 years ago

We have now pretty much everything except the scaling

spanezz commented 4 years ago

This, the new image metadata, and ssite meta, should be good enough to implement an initial support for images for blog pages. I'd close this, and we can open new issues for things like scaling, with use cases for them.