mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-04 10:29:36 +02:00
Merge branch 'master' into version/4
This commit is contained in:
@@ -36,7 +36,7 @@ func colorspaceToResult(pctx *pipelineContext, img *vips.Image, po *options.Proc
|
|||||||
} else if !keepProfile {
|
} else if !keepProfile {
|
||||||
// We don't import ICC profile and don't want to keep it,
|
// We don't import ICC profile and don't want to keep it,
|
||||||
// so we need to transform it to sRGB for maximum compatibility
|
// 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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -563,7 +563,7 @@ vips_icc_export_srgb(VipsImage *in, VipsImage **out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
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);
|
return vips_icc_transform(in, out, "sRGB", "embedded", TRUE, "pcs", vips_icc_get_pcs(in), NULL);
|
||||||
}
|
}
|
||||||
|
@@ -856,7 +856,7 @@ func (img *Image) ExportColourProfileToSRGB() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (img *Image) TransformColourProfile() error {
|
func (img *Image) TransformColourProfileToSRGB() error {
|
||||||
var tmp *C.VipsImage
|
var tmp *C.VipsImage
|
||||||
|
|
||||||
// Don't transform is there's no embedded profile or embedded profile is sRGB
|
// Don't transform is there's no embedded profile or embedded profile is sRGB
|
||||||
@@ -866,10 +866,10 @@ func (img *Image) TransformColourProfile() error {
|
|||||||
return nil
|
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)
|
C.swap_and_clear(&img.VipsImage, tmp)
|
||||||
} else {
|
} else {
|
||||||
log.Warningf("Can't transform ICC profile: %s", Error())
|
log.Warningf("Can't transform ICC profile to sRGB: %s", Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@@ -65,7 +65,7 @@ int vips_icc_restore(VipsImage *in, VipsImage **out);
|
|||||||
int vips_icc_import_go(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_go(VipsImage *in, VipsImage **out);
|
||||||
int vips_icc_export_srgb(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_icc_remove(VipsImage *in, VipsImage **out);
|
||||||
int vips_colourspace_go(VipsImage *in, VipsImage **out, VipsInterpretation cs);
|
int vips_colourspace_go(VipsImage *in, VipsImage **out, VipsInterpretation cs);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user