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

Tiled Gallery block: images are served with Photon, but not resized #11782

Closed
ChrisBegley opened this issue Jan 11, 2019 · 4 comments
Closed
Assignees
Labels
[Block] Tiled Gallery [Feature] Tiled Gallery A different way to display image galleries on your site, in different organizations and shapes. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Focus] Performance [Pri] High [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@ChrisBegley
Copy link

Steps to reproduce the issue

  1. Add a Tiled Gallery with Gutenberg using large, hi-res images.
  2. The images on the back end and front end aren't resized with Photon. They are loading in the large, full-sized images instead. This causes the browser to freeze up and leads to slow loading on the front end.

What I expected

Photon should have added the "w" and "h" attributes to load in smaller versions of the images. This works correctly when using Tiled Gallery and the Classic Editor.

What happened instead

Tiled Gallery (Gutenberg) loads in the full-sized images. This causes the browser to freeze on the back end and the images to load in slowly on the front end if the images are very large.

@jeherve
Copy link
Member

jeherve commented Jan 11, 2019

Thanks for the report!

I'll move this issue to the wp-calypso repo, where the Tiled Gallery block is being developed.

For reference, here is how things look like for an image in a tiled gallery inserted via the classic block:

src="https://i0.wp.com/mysite.com/wp-content/uploads/2019/01/test.jpeg?zoom=2&w=423&h=282"

vs. an image in the tiled gallery block:

src="https://i1.wp.com/mysite.com/wp-content/uploads/2019/01/test.jpeg

It does not include any size parameters, and thus serve an uncached, full version of the image.

@jeherve jeherve transferred this issue from Automattic/jetpack Jan 11, 2019
@jeherve jeherve changed the title 6.9 Gutenberg Tiled Gallery doesn't resize images with Photon Tiled Gallery block: images are served with Photon, but not resized Jan 11, 2019
@sirreal
Copy link
Member

sirreal commented Jan 11, 2019

Thanks for the report @ChrisBegley!

Indeed, this is a limitation of the current block and it's something we plan to improve in a future version. https://github.com/Automattic/wp-calypso/pull/29787 includes some rough ideas using a srcset.

The Mosaic and Column layouts will use full sized images that have their container sizes adjusted to fit the layout. This happens dynamically and adapts to the gallery's container size. We didn't want to refetch photon images on every resize, but an option might be to refetch images when some threshold is passed.

The Square and Circle layouts are adjusted using photon, their width and height are cropped to make a square image the size of the smallest dimension.

We'll be exploring how best to improve this sometime soon and I'd invite you to be a part of that conversation 🙂

@sirreal
Copy link
Member

sirreal commented Feb 13, 2019

I'm working on an implementation that fixes this in Automattic/wp-calypso#30724, #11397

@simison simison transferred this issue from Automattic/wp-calypso Apr 1, 2019
@simison simison added [Feature] Tiled Gallery A different way to display image galleries on your site, in different organizations and shapes. [Focus] Performance [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Pri] High [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Apr 1, 2019
@jeherve
Copy link
Member

jeherve commented Mar 5, 2020

This should now be fixed.

@jeherve jeherve closed this as completed Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Tiled Gallery [Feature] Tiled Gallery A different way to display image galleries on your site, in different organizations and shapes. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Focus] Performance [Pri] High [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

4 participants