MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / shouldImportICC

Function shouldImportICC

processing/colorspace_to_processing.go:68–79  ·  view source on GitHub ↗

shouldImportICC returns true if we need to import ICC profile for the image.

(img *vips.Image)

Source from the content-addressed store, hash-verified

66
67// shouldImportICC returns true if we need to import ICC profile for the image.
68func shouldImportICC(img *vips.Image) bool {
69 interp := img.GuessInterpretation()
70
71 // Skip ICC import for RGB and grayscale images, since all our operations
72 // are designed to work in these colorspaces and we don't want to mess with them.
73 return interp != vips.InterpretationRGB &&
74 interp != vips.InterpretationSRGB &&
75 interp != vips.InterpretationRGB16 &&
76 interp != vips.InterpretationScRGB &&
77 interp != vips.InterpretationGrey16 &&
78 interp != vips.InterpretationBW
79}

Callers 1

Calls 1

GuessInterpretationMethod · 0.80

Tested by

no test coverage detected