mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
Import ICC after resize if linear colorspace was not used
This commit is contained in:
parent
351121d040
commit
ac4f0e5dae
12
process.go
12
process.go
@ -320,13 +320,13 @@ func transformImage(ctx context.Context, img **C.VipsImage, data []byte, po *pro
|
||||
return err
|
||||
}
|
||||
|
||||
if err = vipsImportColourProfile(img); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
convertToLinear := conf.UseLinearColorspace && (scale != 1 || po.Dpr != 1)
|
||||
|
||||
if convertToLinear {
|
||||
if err = vipsImportColourProfile(img); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = vipsLinearColourspace(img); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -419,6 +419,10 @@ func transformImage(ctx context.Context, img **C.VipsImage, data []byte, po *pro
|
||||
if err = vipsFixColourspace(img); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err = vipsImportColourProfile(img); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if po.Expand && (po.Width > int((*img).Xsize) || po.Height > int((*img).Ysize)) {
|
||||
|
Loading…
Reference in New Issue
Block a user