mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-11 04:32:29 +02:00
Merge branch 'master' into version/3
This commit is contained in:
19
vips/vips.go
19
vips/vips.go
@@ -580,12 +580,7 @@ func (img *Image) ImportColourProfile() error {
|
||||
}
|
||||
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
// No embedded profile
|
||||
if img.VipsImage.Type != C.VIPS_INTERPRETATION_CMYK {
|
||||
// vips doesn't have built-in profile for other interpretations,
|
||||
// so we can't do anything here
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if C.vips_icc_import_go(img.VipsImage, &tmp) == 0 {
|
||||
@@ -600,8 +595,8 @@ func (img *Image) ImportColourProfile() error {
|
||||
func (img *Image) ExportColourProfile() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// Don't export is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
// Don't export is there's no embedded profile or embedded profile is sRGB
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 || C.vips_icc_is_srgb_iec61966(img.VipsImage) == 1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -617,8 +612,8 @@ func (img *Image) ExportColourProfile() error {
|
||||
func (img *Image) ExportColourProfileToSRGB() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// Don't export is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
// Don't export is there's no embedded profile or embedded profile is sRGB
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 || C.vips_icc_is_srgb_iec61966(img.VipsImage) == 1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -634,8 +629,8 @@ func (img *Image) ExportColourProfileToSRGB() error {
|
||||
func (img *Image) TransformColourProfile() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// Don't transform is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
// Don't transform is there's no embedded profile or embedded profile is sRGB
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 || C.vips_icc_is_srgb_iec61966(img.VipsImage) == 1 {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user