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

TimberImageHelper::delete_generated_files doesn’t delete jpg files created through tojpg filter #894

Closed
gchtr opened this issue Mar 8, 2016 · 2 comments

Comments

@gchtr
Copy link
Member

gchtr commented Mar 8, 2016

Expected behavior

TimberImageHelper::delete_generated_files() should automatically delete all generated image sizes when an attachment is deleted.

Actual behavior

Some JPG files are not deleted, when they were generated through tojpg Twig filter that was used on a PNG file.

Steps to reproduce behavior

  1. Upload PNG image to Media Library.
  2. Assign PNG to post as featured image.
  3. Bring featured image into template through <img src="{{post.thumbnail.src|tojpg|resize(200, 200)}}">
  4. Check if JPG file with dimensions 200x200 is present in wp-content/uploads folder.
  5. Choose _Delete permanently_ on uploaded PNG in Media Library.
  6. Check for JPG file with dimensions 200x200 still present in wp-content/uploads folder.

What version of WordPress, PHP and Timber are you using?

WordPress 4.4.2, PHP 5.6.10, Timber 0.22.5

How did you install Timber?

Upgraded to newest version via plugin updater in WordPress.

@connorjburton connorjburton added needs-investigation We've got all the info, now someone needs to look into this to figure out what's going on bug and removed needs-investigation We've got all the info, now someone needs to look into this to figure out what's going on labels Mar 8, 2016
@jarednova
Copy link
Member

@gchtr: thanks for filing this detailed issue (and using the issue template, it really helps us zero-in on the problem quickly and provide a patch). @connorjburton made changes to the code and submitted a PR in #897 that resolves the issue. Thanks to you both for making the fix happen!

@gchtr
Copy link
Member Author

gchtr commented Mar 13, 2016

@jarednova @connorjburton Thanks for the fix! I think the issue template works really well, for both sides.

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

No branches or pull requests

3 participants