timber icon indicating copy to clipboard operation
timber copied to clipboard

[BUG] `towebp` filter always returns new filename, even when conversion was unsuccessful

Open bitfactory-robin-martijn opened this issue 1 year ago • 1 comments

Expected Behavior

When using the towebp filter, the original filename should be returned if the file could not be converted.

Actual behavior

The filename is returned with towebp after it.

Steps to reproduce behavior

{{ file | towebp }}

If file is white-castle.tif, this still returns white-castle.webp.

Notes

  • I just submitted a PR that also touches on the towebp filter, but that shouldn't affect solving this issue: https://github.com/timber/timber/pull/2876
  • If this ticket is approved, I think it should be added to https://github.com/timber/timber/issues/2866

What version of Timber are you using?

2.0.0

What version of WordPress are you using?

No response

What version of PHP are you using?

No response

How did you install Timber?

None

Hi @expedition-robin-martijn , thank you so much for your ticket and PRs you created! I will add this to the Image handling ticket and we will take a look at your pull requests.

Levdbas avatar Jan 06 '24 12:01 Levdbas