From 83e64ff2d3a09f1023d8e45b51cdc906baefb5e7 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Wed, 20 Aug 2025 17:00:54 +0300 Subject: [PATCH] TransformColourProfile -> TransformColourProfileToSRGB --- processing/colorspace_to_result.go | 2 +- vips/vips.c | 2 +- vips/vips.go | 6 +++--- vips/vips.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/processing/colorspace_to_result.go b/processing/colorspace_to_result.go index 95aa486c..9f1cc0d4 100644 --- a/processing/colorspace_to_result.go +++ b/processing/colorspace_to_result.go @@ -36,7 +36,7 @@ func colorspaceToResult(pctx *pipelineContext, img *vips.Image, po *options.Proc } else if !keepProfile { // We don't import ICC profile and don't want to keep it, // so we need to transform it to sRGB for maximum compatibility - if err := img.TransformColourProfile(); err != nil { + if err := img.TransformColourProfileToSRGB(); err != nil { return err } } diff --git a/vips/vips.c b/vips/vips.c index 481cfca4..9edf0e92 100644 --- a/vips/vips.c +++ b/vips/vips.c @@ -546,7 +546,7 @@ vips_icc_export_srgb(VipsImage *in, VipsImage **out) } int -vips_icc_transform_go(VipsImage *in, VipsImage **out) +vips_icc_transform_srgb(VipsImage *in, VipsImage **out) { return vips_icc_transform(in, out, "sRGB", "embedded", TRUE, "pcs", vips_icc_get_pcs(in), NULL); } diff --git a/vips/vips.go b/vips/vips.go index aedf1ebb..3be3f00b 100644 --- a/vips/vips.go +++ b/vips/vips.go @@ -853,7 +853,7 @@ func (img *Image) ExportColourProfileToSRGB() error { return nil } -func (img *Image) TransformColourProfile() error { +func (img *Image) TransformColourProfileToSRGB() error { var tmp *C.VipsImage // Don't transform is there's no embedded profile or embedded profile is sRGB @@ -863,10 +863,10 @@ func (img *Image) TransformColourProfile() error { return nil } - if C.vips_icc_transform_go(img.VipsImage, &tmp) == 0 { + if C.vips_icc_transform_srgb(img.VipsImage, &tmp) == 0 { C.swap_and_clear(&img.VipsImage, tmp) } else { - log.Warningf("Can't transform ICC profile: %s", Error()) + log.Warningf("Can't transform ICC profile to sRGB: %s", Error()) } return nil diff --git a/vips/vips.h b/vips/vips.h index 7daf20e2..1930d36c 100644 --- a/vips/vips.h +++ b/vips/vips.h @@ -59,7 +59,7 @@ int vips_icc_restore(VipsImage *in, VipsImage **out); int vips_icc_import_go(VipsImage *in, VipsImage **out); int vips_icc_export_go(VipsImage *in, VipsImage **out); int vips_icc_export_srgb(VipsImage *in, VipsImage **out); -int vips_icc_transform_go(VipsImage *in, VipsImage **out); +int vips_icc_transform_srgb(VipsImage *in, VipsImage **out); int vips_icc_remove(VipsImage *in, VipsImage **out); int vips_colourspace_go(VipsImage *in, VipsImage **out, VipsInterpretation cs);