-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support srcset for multiple image formats #1241
Comments
Well, you can already serve webp in PhotoSwipe, either serve the image from server side based on headers, or detect webp support via JS (with something like Modernizr) and just rewrite the URL, e.g. like so: pswp.listen('gettingData', function(index, item) {
if (supportsWebp) {
item.src = item.src.replace('.jpg', '.webp');
}
}); |
Right - as I listed in the options considered:
|
Not quite understand your second point, as PhotoSwipe is a JS library, and loads all images dynamically. |
closed by v5 #1749 |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We're using photoswipe and would like to serve
webp
images to chrome users.I've considered the following options:
<picture> <source srcset="..." type="image/webp" />
(doesn't work with PhotoSwipe)Would a PR introducing support for multiple image formats be welcome?
The text was updated successfully, but these errors were encountered: