Comments (6)
Looking forward for this release too. Thanks.
from wp-tevko-responsive-images.
Looks like there are two different cases we need to be aware of with Jetpack's Photon module:
Content images: Photon doesn't affect images being added to content, but instead adds a filter to the_content
that finds all images in a post and swaps out the src attribute for the photon url when they are displayed on the front end. (FWIW, the code for that filter is pretty nice and could be useful when we filter sizes
attributes in the content).
Template images: When we're building image tags on the front end—for a featured image or any other manually generated image tag—Photon is filtering image_downsize()
, which is what wp_get_attachment_image_src()
uses to return an array containing the url, width, and height of an image. We use the width and height information to determine srcset candidates. However, Photon's filter returns a url string for the url and false for the height and width attributes that we need. We could shim this on our end, which is what the suggested patch from the support forum linked above does, but ultimately I think this is a bug with Photon and we should reach out to them with a fix for their filter.
from wp-tevko-responsive-images.
@joemcgill agreed. Let's raise an issue in slack tomorrow
from wp-tevko-responsive-images.
After talking this through with the JetPack team, they are intentionally returning falsey values for height and width and they're not likely to fix this. Additionally, they're handling a lot of the optimizations that we are providing on their end, so we really don't need to worry about adding support for Photon in srcset
attributes. For those reasons I think we can close this issue.
from wp-tevko-responsive-images.
Thanks for the info Joe, but just to make this clear, does Photon makes this plugin redundant and they should not be used in conjunction?
from wp-tevko-responsive-images.
In some ways, it seems that way, yes. In the mean time, I wouldn't recommend using them together since Photon is generating optimized image sizes for you on the fly. I'll keep my eye on this issue and will update it with any best practices we learn.
from wp-tevko-responsive-images.
Related Issues (20)
- Document remove_filter( 'the_content', 'tevkori_replace_data_sizes' );
- `the_post_thumbnail()` not returning `srcset` attributes. HOT 2
- Function to output responsive images in themes HOT 1
- Should we increase the default of 'max_srcset_image_width'? HOT 1
- Update documentation of 'wp_get_attachment_image_sizes()'
- Incorrect inline documentation HOT 2
- Problem with filter deprecation notices HOT 1
- Test test_tevkori_filter_content_images() failing against WP nightlies HOT 2
- Full URL path to files HOT 1
- Add custom srcset + sizes values to post thumbnails? HOT 1
- Incorrect srcset for retina images in 3.1.0 HOT 1
- Image tags without ending slash are never made responsive. HOT 4
- wp_calculate_image_srcset(): Reduce accepted aspect ratio difference HOT 2
- Default theme image options can make test fail HOT 2
- Responsive images broken on edited/imported content HOT 1
- Update documentation about plugin features HOT 2
- Problem with WooCommerce images HOT 4
- Use custom sizes attribute with the_post_thumbnail HOT 5
- Backport WP 4.4.1 fixes. HOT 1
- Deprecate/remove calls to `_wp_upload_dir_baseurl()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-tevko-responsive-images.