Skip to content

Add 2k and 4k scale sizes#205

Merged
davisagli merged 5 commits intomainfrom
largescales
Dec 19, 2025
Merged

Add 2k and 4k scale sizes#205
davisagli merged 5 commits intomainfrom
largescales

Conversation

@davisagli
Copy link
Member

This is needed to avoid a reduction in image quality from plone/volto#7655

I didn't add an upgrade step yet but we probably should (careful to only add the new scales, and not change others)

@mister-roboto
Copy link

@davisagli thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@davisagli
Copy link
Member Author

@jenkins-plone-org please run jobs

Copy link
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wesleybl
Copy link
Member

@davisagli A curiosity. If the image isn't 2k, these new scales won't be generated, correct?

@davisagli
Copy link
Member Author

@wesleybl In Plone 6 scales are generated on demand the first time they are downloaded.

We generate the metadata which lists the scales in 2 different places:

@wesleybl
Copy link
Member

@davisagli Are the larger scales generated by the RESTAPI returned to the srcset attribute? If so, is there a risk that the browser might select them, resulting in distorted images?

@davisagli
Copy link
Member Author

@sneridagh I added an upgrade step.

Are the larger scales generated by the RESTAPI returned to the srcset attribute? If so, is there a risk that the browser might select them, resulting in distorted images?

Not distorted images, but when the original image is very large, we start giving the browser more options for serving a smaller one. We also have to set sizes on the img tag so that the browser can pick the appropriate scale from the srcset. That's part of what plone/volto#7655 is for.

@mauritsvanrees
Copy link
Member

@jenkins-plone-org please run jobs

Co-authored-by: Maurits van Rees <maurits@vanrees.org>
@davisagli davisagli merged commit c4611cb into main Dec 19, 2025
9 of 11 checks passed
@davisagli davisagli deleted the largescales branch December 19, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants