Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let ImageSizerPlugin find thumbnails generated by ImageThumbnailsPlugin #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Let ImageSizerPlugin find thumbnails generated by ImageThumbnailsPlugin #258

wants to merge 1 commit into from

Conversation

dandersson
Copy link

Problem: If one generates thumbnails with ImageThumbnailsPlugin from e.g. images in content/media/images, the resulting thumbnails are placed in the directory content/.thumbnails/media/images with the given thumbnail prefix prepended to the file name. The thumbnails are supposed to be linked in the HTML documents as if they still were in the same directory as the original image, though. The rationale for this is given in the source as:

# Prepare path, make all thumnails in single place(content/.thumbnails)
# for simple maintenance but keep original deploy path to preserve
# naming logic in generated site

So, when including e.g. images/thumb_myimage.jpg in the document, ImageSizerPlugin will look at the HTML document, find this path, discover that it does not correspond to a physical file on disk and continue without other action than a warning message: [resource] has an unknown image.

Solution: I added an extra path check that should find these thumbnails. It works in my test site, at least, with all path definitions at default.

The .thumbnails/ path is hardcoded, which is not ideal, but it is the way it is currently solved in ImageThumbnailsPlugin as well. I can think of other solutions, but this is probably the one that requires the least effort and reorganization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant