1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-09-16 09:36:18 +02:00

TransformColourProfile -> TransformColourProfileToSRGB

This commit is contained in:
DarthSim
2025-08-20 17:00:54 +03:00
parent e1764ad580
commit 83e64ff2d3
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@@ -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);