mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-23 11:14:48 +02:00
Remove ICC if source image is linear
This commit is contained in:
parent
bf9e54620f
commit
46e63464f7
@ -3,6 +3,7 @@
|
||||
## [Unreleased]
|
||||
### Fix
|
||||
- Fix parsing of HEIF files with large boxes.
|
||||
- Fix wrong colors when the source image has a linear colorspace.
|
||||
|
||||
## [3.19.0] - 2023-08-21
|
||||
### Add
|
||||
|
@ -18,7 +18,11 @@ func importColorProfile(pctx *pipelineContext, img *vips.Image, po *options.Proc
|
||||
|
||||
convertToLinear := config.UseLinearColorspace && (pctx.wscale != 1 || pctx.hscale != 1)
|
||||
|
||||
if convertToLinear || !img.IsRGB() {
|
||||
if img.IsLinear() {
|
||||
// The image is linear. If we keep its ICC, we'll get wrong colors after
|
||||
// converting it to sRGB
|
||||
img.RemoveColourProfile()
|
||||
} else if convertToLinear || !img.IsRGB() {
|
||||
if err := img.ImportColourProfile(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user