Let ImageSizerPlugin find thumbnails generated by ImageThumbnailsPlugin #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: If one generates thumbnails with
ImageThumbnailsPlugin
from e.g. images incontent/media/images
, the resulting thumbnails are placed in the directorycontent/.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: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 inImageThumbnailsPlugin
as well. I can think of other solutions, but this is probably the one that requires the least effort and reorganization.