Merge branch 'master' into version/3

This commit is contained in:
DarthSim
2021-07-08 16:48:40 +06:00
4 changed files with 44 additions and 12 deletions

View File

@@ -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
}