Skip to content

Use "srcset" in screenshot viewer (add-on detail page) #10003

Closed

Description

@mstriemer

UPDATE June 2018:

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.

Activity

  1. muffinresearch commented on Jan 3, 2017

    @muffinresearch
    Contributor

    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

  2. mstriemer commented on Jan 3, 2017

    @mstriemer
    ContributorAuthor

    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.

    [1] http://photoswipe.com/documentation/responsive-images.html

  3. Ryuno-Ki commented on Jan 5, 2017

    @Ryuno-Ki

    Could a service like Cloudinary's Responsive Image Breakpoints Generator ease the job?

    @darkwing seem to be pretty excited about Cloudinary after all …

  4. dessant commented on Oct 31, 2017

    @dessant

    The carousel currently stretches images to fill the available area, making them blurred in most cases, because the backend limits screenshot sizes to 700x525.

  5. kumar303 commented on Oct 31, 2017

    @kumar303
    Contributor

    @dessant could you provide a link to an add-on detail page that demonstrates this?

  6. eviljeff commented on Oct 31, 2017

    @eviljeff
    Member

    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.

  7. dessant commented on Oct 31, 2017

    @dessant

    Yeah, all listings are affected. @kumar303, it's easier to spot it when the page is loaded in responsive design mode with 4k resolution.

  8. changed the title [-]Optimize image sizes in screenshot viewer[/-] [+]Use "srcset" in screenshot viewer (add-on detail page)[/+] on Jun 25, 2018
  9. rebmullin commented on Jul 5, 2018

    @rebmullin
    Contributor

    When addressing this, which should start looking into a new gallery that works well with srcset. Also consider #11918

  10. willdurand commented on Jul 5, 2019

    @willdurand
    Member

    I don't think we'll ever do this, so I'm closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    repository:addons-frontend

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions