Repository navigation
fix: preserve colors in uploaded images (draft, not for merge) - #828
Closed
anttikissa wants to merge 1 commit into
Closed
anttikissa wants to merge 1 commit into
anttikissa wants to merge 1 commit into
Conversation
Author
|
The things I had to do to make it work: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #806.
Not for merge as-is: this shows a working color fix, but it needs server changes the diff can't make. Uploads are converted to sRGB with libvips before metadata is removed, so Display P3 screenshots keep their colors instead of looking washed out. Size limit, WebP quality, orientation handling and metadata removal stay the same.
Changes:
CreateCommitImageFilesuses libvips (jcupitt/vips) instead of GD: load, autorotate, convert to sRGB, resize, save WebP without metadata.Server requirements (why this is a draft):
ffi.enable=trueglobally (php-vips can't use preloading)zend.max_allowed_stack_size=-1on PHP 8.3+DYLD_INSERT_LIBRARIESon macOS.Known gaps: libvips errors are reported as validation errors, PNG EXIF orientation is now applied (GD ignores it) but untested, and only the image tests were run locally (no coverage driver).