You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use "srcset" in screenshot viewer (add-on detail page) #10003
The API now returns screenshots of different sizes along with the dimensions for each version. We can request different dimension to be implemented in the API so that we can use them in the frontend.
The idea would be to use srcset for that, either using the current viewer (ttp://photoswipe.com/documentation/responsive-images.html) or by adopting a new viewer library that has srcset support built-in.
Currently the frontend has no idea what size an image is. Because of that it is currently set to 320x200 since that seemed reasonable for a mobile device. This is fine for landscape photos but isn't great for portrait and the full size image doesn't scale up at all unless you pinch to zoom.
addons-server has the size data, we need it returned in the API so that we can come up with a good size though.
Once we've got the data, let's pass it to photoswipe and maybe add some scaling logic so it's never bigger than the screen.
Does the component support srcset [1] ? If not we should think about adding that or patching upstream. Then we can supply various image sizes (we're planning to expand support at upload for more formats - we can add input to that project) and let the client do the heavy lifting as to what image is the best fit.
It doesn't support srcset but since we tell it what pictures to use we could do that ourselves. There is some documentation [1] on how to accomplish this, it doesn't look like a ton of fun unfortunately.
The carousel currently stretches images to fill the available area, making them blurred in most cases, because the backend limits screenshot sizes to 700x525.
Activity
muffinresearch commentedon Jan 3, 2017
Does the component support
srcset[1] ? If not we should think about adding that or patching upstream. Then we can supply various image sizes (we're planning to expand support at upload for more formats - we can add input to that project) and let the client do the heavy lifting as to what image is the best fit.[1] http://caniuse.com/#search=srcset
mstriemer commentedon Jan 3, 2017
It doesn't support
srcsetbut since we tell it what pictures to use we could do that ourselves. There is some documentation [1] on how to accomplish this, it doesn't look like a ton of fun unfortunately.[1] http://photoswipe.com/documentation/responsive-images.html
Ryuno-Ki commentedon Jan 5, 2017
Could a service like Cloudinary's Responsive Image Breakpoints Generator ease the job?
@darkwing seem to be pretty excited about Cloudinary after all …
dessant commentedon Oct 31, 2017
The carousel currently stretches images to fill the available area, making them blurred in most cases, because the backend limits screenshot sizes to 700x525.
kumar303 commentedon Oct 31, 2017
@dessant could you provide a link to an add-on detail page that demonstrates this?
eviljeff commentedon Oct 31, 2017
Should be reproducible with any add-on that has screenshots, if your browser is above 700px wide. e.g. https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/ - the screenshot always resizes to fill the browser width.
dessant commentedon Oct 31, 2017
Yeah, all listings are affected. @kumar303, it's easier to spot it when the page is loaded in responsive design mode with 4k resolution.
[-]Optimize image sizes in screenshot viewer[/-][+]Use "srcset" in screenshot viewer (add-on detail page)[/+]rebmullin commentedon Jul 5, 2018
When addressing this, which should start looking into a new gallery that works well with srcset. Also consider #11918
willdurand commentedon Jul 5, 2019
I don't think we'll ever do this, so I'm closing this issue for now.