Skip to content
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

Gallery Block - Include resized images #13842

Closed
jordan-webdev opened this issue Feb 12, 2019 · 9 comments
Closed

Gallery Block - Include resized images #13842

jordan-webdev opened this issue Feb 12, 2019 · 9 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Testing Needs further testing to be confirmed.

Comments

@jordan-webdev
Copy link

jordan-webdev commented Feb 12, 2019

I would expect that the images displayed through the gallery embed would be resized, in order to save bandwidth. I have a gallery with five 600px wide by 350px tall images in a 577px container. I do see that the sizes attribute has been added to them ("max-width: 600px) 100vw, 600px", however, the full 600px image is still the one being loaded, even though some of the images are being resized to only 181px with CSS.

I would expect this to display a smaller version, much like the function wp_get_attachment_image() does. This limits the use of the gallery block, especially on mobile devices where data is a larger consideration.

@youknowriad
Copy link
Contributor

Seems like a duplicate of #13434

@jordan-webdev
Copy link
Author

jordan-webdev commented Feb 14, 2019

No, I don't mean custom image sizes. I mean, it should automatically scale the image down, even if "full" is selected, just like wp_get_attachment_image() does. The images are 600px by 350px, so I would think that smaller versions of them should exist normally, even without custom sizes, right?

@youknowriad youknowriad reopened this Feb 15, 2019
@youknowriad
Copy link
Contributor

I reopened to ensure people than knows more about "Media" can chime in.
In my tests, I do see the srcset with the different image sizes added.

@youknowriad youknowriad added [Feature] Media Anything that impacts the experience of managing media Needs Testing Needs further testing to be confirmed. labels Feb 15, 2019
@oandregal oandregal added the [Block] Gallery Affects the Gallery Block - used to display groups of images label Apr 3, 2019
@benoitchantre
Copy link
Contributor

@youknowriad With WordPress 5.2, Gutenberg 6.1 and Twenty Ninteen, I get the following markup:

<li class="blocks-gallery-item">
    <figure>
        <a href="<url to to full size>" class="wp-image-3765">
            <img src="<url to large size>" alt="" data-id="3769">
        </a>
    </figure>
</li>

I see no srcset attribute.

@yduke
Copy link

yduke commented Jul 15, 2019

This is definitely a problem when user add like 20 images in 1080p or even 4k size to one gallery block, a thumbnail size for "src" and full size for link will be good.

@moritzebeling
Copy link

All images should always get a full srcset, no matter what pixel-size was defined within the editor or what column layout was picked. This is not a bug, it’s missing functionality, making the Gutenberg gallery essentially useless for responsive websites.

@designsimply
Copy link
Member

Passing along a report of trouble using the gallery block seen in mobile support:

I am using photo galleries on The Experiential Studios site. If I use Blocks, it loads way slow. If I use Classic editor, the photos shuffle within the editor itself ("random order" unclicked). I need them to stay in the order I put them. Once it shuffle, it takes an hour to put them back in the correct order. Please help!

(internal reference: 2281705-zen)

The problem with the Classic editor sounds like the issue at Automattic/wp-calypso#14843 h/t @rachelmcr and the problem with the gallery block loading too slowly sounds like this issue.

@skorasaurus
Copy link
Member

skorasaurus commented Feb 25, 2020

This is confirmed and can have the needs testing label removed;

It's a duplicate of #9620

(This is ultimately a duplicate of #6177:

Although a theme may properly create multiple images that are smaller;
the gallery block will not use them )

@noisysocks
Copy link
Member

Duplicate of #9620 which was in turn moved to Core Trac.

https://core.trac.wordpress.org/ticket/49966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

9 participants