-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
imagehelper - filename (towebp, tojpg) #2556
base: 1.x
Are you sure you want to change the base?
Conversation
Thanks so much @EpicKau ! It looks like some tests need to be updated to match with this new naming convention. Could you give it a look? |
@jarednova So what I see is that most time the test failed because of "assertFileExists" check. ("Failed asserting that file "XYZ" exists.") |
Exactly @EpicKau (at least, that's what it looks like) — just need to reflect the new expected naming convention |
So I ran into this issue #2748 as well and found this PR after some digging. #2535 seems to be related as well. I did some local tests and this pr fixes both problems for me. both the webp and and jpg generated images are removed. Only files that are not accounted for are when running towebp and tojpg on crops that will result to filenames like these.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, websites that use the ToJpg and ToWebp operations will be left with quite a few stray webp and jpg images.
Do we have to consider this as a breaking change? Because I see the following problems here:
- It will trigger the images to be regenerated and for sites with a lot of images, right? This could create performance issues or even max execution time errors.
- It might have serious impact on the whole size of the website, which could lead to problems on websites that have a limited available space.
Fixes #897
Issue
files are not deleted, when they were generated through timber filter. (webp, png)
Solution
Change generated filenames to have target fileformat in the filename.
Added more calls to delete_generated_files with specific regex for fileformat
I hope it helps.