mindkomm/timmy

Resizing gone wrong since Timber 1.2.3

Closed this issue · 1 comments

The TimberImage->src() method got refactored to use wp_get_attachment_url(). This returns the url of the thumbnail as a default. Which results in resizing the wrong image.

For example:
/uploads/doge-150x150-c-default-1200x0-c-default.jpg

See my comment: timber/timber@2b0c06a

Changing

$file_src   = $timber_image->src();

to

$file_src   = $timber_image->src('original');

in Timmy.php line 314 fixes it for now.

gchtr commented

Hey @davidmaneuver, thanks a lot for looking into this issue!

As a quick fix I think it’s good to add the requested size explicitly. The src method now works with wp_get_attachment_image_src, which Timmy hooks into itself. This is a new behaviour that I have to look further into to make sure things are not overcomplicated and to check performance.
Because of this, I’m not sure yet if Timber should always return the full size or the default size of wp_get_attachment_image_src, which is thumbnail.

The size original works, because Timmy allows it as an alias to full (the default name for the original size) for better compatibility with the WP SEO plugin.