-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add quality setting for JP(E)G preview images #39349
Conversation
As usual, add a docs issue when close to merge 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small typo.
Updated the PR with a changelog and improved the docs text. I don't think we can test this in a meaningful way. |
@JammingBen what do you think about adding the \imagejpeg PHP docs to the config.sample.php description? |
If this goes ahead, I wonder what will be a suitable test? Do we save a couple of JPG previews at different quality, and the test sets the quality, let's the system generate a preview, and does a binary comparison with the saved JPG test fixture? And existing previews that have already been generated will be at the default (or previous) quality. Is there any requirement to be able to optionally "regenerate all existing previews" (occ command or...) after the quality setting has been changed? |
f6ad01b
to
a2fa643
Compare
@phil-davis we were already been thinking about a command like this, which simply deletes every preview. But @pmaier1 needs to decide if this is a good idea |
Guys, we got it wrong. Previews will always be stored as Same request, quality 100 (see the difference in size): Quality 1: On my local disk, the file is always exactly the same. |
@JammingBen this is lovely, even if I don't understand why we use PNG in favour of JPGEG (we should not change it right now). |
a2fa643
to
0a75d75
Compare
That also means we could test the behavior simply by comparing the size of 2 responses (one quality 1, the other quality 100). @phil-davis Can that be done via acceptance tests? |
f517429
to
969619e
Compare
Sure can. If we just want to confirm that there are size differences, then we can just mention in the tests the expected length of the response body (or be more fancy and look inside the data for some JPG information about the "file" size and/or resolution) |
At first sight I couldn't find a nice way to actually analyse the quality of an JPEG image via PHP. The quality string is included somewhere in the response body, but it seems a bit "random" to me. For now I added a test to check for the file size. |
Then the config parameter should be renamed to avoid misleading and confusement. |
9beee08
to
a8fc1d9
Compare
Note that I have adopted my text suggestion regarding config.sample above with regards that it not for preview images! |
Even a small detail, |
What do you mean? The setting is for preview images. Not how they are being stored, but how they are being delivered/displayed. IMO the value name is as clear as it gets now. We cannot use an endless long value name just to ensure every little detail is included :/ |
The term 'preview' is confusing as people will think these are the thumbnails. It would be better to use the term 'display'. This would perfectly point to what it is and what it is not. In case we stick to preview (also ok) we have to highlight in the config.sample text that this has nothing to do with thumbnails. Just let me know the direction an I will adopt the text suggestion. |
But we are talking about thumbnails! The only misconception here is the fact that the |
For better understanding:
Is this new config setting about 1. or 2. ? |
It's always about 1. In detail that means: the little thumbnails in the files table as well as the quite larger thumbnails on top of the sidebar. Additionally it can be about 2., too, if you use the |
This is a valuable info, I will adopt the config.sample suggestion above accordingly. As this change is also for true thumbnails, how does this effect existing thumbs? is there a need for recreation? |
@JammingBen I have adopted the config.sample text above based on the discussion. Please have a look and commit in case you agree. |
No, that change will be applied immediately.
Hm I cannot find it, could you link the comment here please? I only see your first review on the outdated text. |
It is just below of #39349 (comment) |
c295174
to
f1827a9
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
A new config setting
previewJPEGImageDisplayQuality
has been introduced with which the quality of generated JP(E)G previews can be determined.Related Issue
Types of changes
Checklist:
config-to-docs
forpreviewJPEGImageDisplayQuality
docs#4142