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: photonize image URLs #29495

Closed
simison opened this issue Dec 17, 2018 · 5 comments
Closed

Tiled gallery block: photonize image URLs #29495

simison opened this issue Dec 17, 2018 · 5 comments
Labels
[Block] Tiled Gallery [Goal] Gutenberg Working towards full integration with Gutenberg [Pri] High Address as soon as possible after BLOCKER issues

Comments

@simison
Copy link
Member

simison commented Dec 17, 2018

By using Photon, some shape calculations might be more straightforward and we could save bytes by serving actual square images for square layout, instead of cropping them out.

That said, we'll need to ensure experience stays smooth by using "stepped" Photonized image sizes.

Imagine if you uploaded an image or resized the gallery by opening Gutenberg sidebar; each image would now be slightly different size and start loading a new Photon image. We need to ensure that we don't load new photon image too often, especially in the editor.

Situations that we should test:

  • Adding new images to the gallery
  • Toggling Gutenberg sidebar hidden/visible
  • Changing alignment
  • Resizing the browser window
  • In future, we might have drag'n'drop feature (#28950), how will that be affected?

Suppose in the editor view, we should grab the total width of the gallery and use the same size for each image that we Photonize: that way even if images are shuffled around, they always have an image already loaded.

In the view, we can be a little bit more aggressive with image sizes to save bandwidth.

A bit of code for this already in: https://github.com/Automattic/wp-calypso/pull/29465/files#diff-64399d2ba5e2912315cb18d8cc16dafbR140

Related "use large images" (#29544)

@simison simison added [Goal] Gutenberg Working towards full integration with Gutenberg [Block] Tiled Gallery labels Dec 17, 2018
@sirreal
Copy link
Member

sirreal commented Dec 17, 2018

Are there concerns about privacy or the other reasons sites may disable photon?

@simison
Copy link
Member Author

simison commented Dec 17, 2018

Sites wanting to implement Content security policy headers might not want to add something as generic as s{0,1,2}.wp.com to their policies but I'd assume that applies mostly to corporate users.

If sites implement their own automatic CDN systems, does Photon interfere with that?

@simison
Copy link
Member Author

simison commented Dec 18, 2018

Photon doesn't pick full-width images in Gutenberg: Automattic/jetpack#10984

@simison simison added the [Pri] High Address as soon as possible after BLOCKER issues label Dec 18, 2018
@enejb
Copy link
Member

enejb commented Dec 19, 2018

Are there concerns about privacy or the other reasons sites may disable photon?
cc: @jeherve I think photon is pretty much a requirement for tile galleries. No?

@simison
Copy link
Member Author

simison commented Dec 20, 2018

Are there concerns about privacy or the other reasons sites may disable photon?

cc: @jeherve I think photon is pretty much a requirement for tile galleries. No?

They are for the module; they don't technically have to be for the block.

Tho we're making it a hard dependency for the block, for now, to make some tech more straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Tiled Gallery [Goal] Gutenberg Working towards full integration with Gutenberg [Pri] High Address as soon as possible after BLOCKER issues
Projects
None yet
Development

No branches or pull requests

3 participants