-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
TimberImage Resize combined with Retina creates upscaled image, incorrect URL #404
Comments
I can confirm this. <img src="{{ post.thumbnail.src | retina(2) | resize(2400) | retina(2) }}" /> applying the retina filter twice on an image double the size. |
I've seen a few casual references to |
I can confirm this to. I use this also like this: {{ product.thumbnail | retina(2) | resize(700, 600, 'center') | retina(2) }} |
Same here, this should be fixed. |
That is because in current implementation if One quick workaround would be to add a Twig filter like this one:
and use it instead of |
I'm evaluating using Timber as a starting point for a new theme. Am I understanding this issue to mean that generating optimized pixel-density images within Timber's framework is borked and has been since 2014? |
This issue is about how (badly) In general, I think that Timber is a solid, production-ready framework and my overall experience is very positive. I recommend that you try it out as it might change your way of thinking about Wordpress theme development. It changed mine. With Timber alongsite your favourite meta-field plugin you can do wonders. Good luck! |
@connorjburton any update here? These images really do look awful. |
This issue is still open. |
@markhowellsmead thanks, that's actually a better workaround than the retinize thingy above. Don't know why I didn't think of that. I'll submit a PR for the docs, since they specifically call out being able to chain |
@zackphilipps Strictly speaking, you could just use |
@markhowellsmead Yup, agree, since you could potentially have 3x and 4x images as well. |
I'm closing all 2+ year old tickets. If someone wants to pick this up, let's make it a fresh issue |
My uploaded source is a 3500px wide image. I want to display this image width:100% at a viewport width of 1200px, on retina (2x) displays.
I could just resize to a width of 2400px...
..which works fine and the image looks great, but i wanted to use the retina filter as shown in the Timber docs (and proposed in issue #371):
This however generates an unsharp image. Looks like it was actually resized to 1200px, and then upscaled to 2400px.
Also, when using the retina filter, the URL returned is incorrect: '/wp-content/uploads/xxxx.jpg'. Without retina filter the correct full URL is returned, 'http://localhost/website-dir/wp-content/uploads/xxxx.jpg'.
Menno
(Using Timber 0.20.8, WP 4.0.1)
The text was updated successfully, but these errors were encountered: