MattKevan/Jekyll-MiniMagick-new

minimagick files not appearing in site.static_files

Closed this issue · 1 comments

MiniMagick is successfully creating the files (I'm using it to make thumbnails in /images/thumbnail/), but when I do a for loop through the site.static_files array, the thumbnails don't appear.

Is that how it's supposed to be? Is there a way to programmatically ask whether the files exist? My code relies on checking whether the image file exists before trying to render it, and its absence in static_files means I'm not sure how to test for that.

Any advice?

To follow up: it appears that the magick-generated files do show up in static_files, but they do not have a .path value, so I can't test the existence of the thumbnail per se, though I could probably test for the existence of two files with the same name and assume that means the thumbnail exists.

As an alternative to testing for the existence of a particular path, is it possible to add a prefix or suffix to the filename itself, so that you'd start with:
/images/staff/Ken.jpg
and end with
/images/thumbs/Ken-thumb.jpg

If I can't test for path=images/thumbs/Ken.jpg, then testing for name=Ken-thumb.jpg would be an adequate alternative.

Any ideas would be most welcome.

Thanks!