mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-01-03 10:43:58 +02:00
Always import ICC if image is not RGB
This commit is contained in:
parent
20960b2013
commit
cae8af9ac5
@ -18,7 +18,7 @@ func importColorProfile(pctx *pipelineContext, img *vips.Image, po *options.Proc
|
||||
|
||||
convertToLinear := config.UseLinearColorspace && (pctx.wscale != 1 || pctx.hscale != 1)
|
||||
|
||||
if convertToLinear || img.IsCMYK() {
|
||||
if convertToLinear || !img.IsRGB() {
|
||||
if err := img.ImportColourProfile(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -600,8 +600,11 @@ func (img *Image) ApplyFilters(blurSigma, sharpSigma float32, pixelatePixels int
|
||||
return nil
|
||||
}
|
||||
|
||||
func (img *Image) IsCMYK() bool {
|
||||
return C.vips_image_guess_interpretation(img.VipsImage) == C.VIPS_INTERPRETATION_CMYK
|
||||
func (img *Image) IsRGB() bool {
|
||||
format := C.vips_image_guess_interpretation(img.VipsImage)
|
||||
return format == C.VIPS_INTERPRETATION_sRGB ||
|
||||
format == C.VIPS_INTERPRETATION_scRGB ||
|
||||
format == C.VIPS_INTERPRETATION_RGB16
|
||||
}
|
||||
|
||||
func (img *Image) ImportColourProfile() error {
|
||||
|
Loading…
Reference in New Issue
Block a user