You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-12-24 00:35:32 +02:00
Remove ICC hacks; Enable ICC support for PNG
This commit is contained in:
16
vips.go
16
vips.go
@@ -578,8 +578,8 @@ func (img *vipsImage) ImportColourProfile() error {
|
||||
func (img *vipsImage) ExportColourProfile() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// 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 {
|
||||
// Don't export is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -595,8 +595,8 @@ func (img *vipsImage) ExportColourProfile() error {
|
||||
func (img *vipsImage) ExportColourProfileToSRGB() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// 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 {
|
||||
// Don't export is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -612,8 +612,8 @@ func (img *vipsImage) ExportColourProfileToSRGB() error {
|
||||
func (img *vipsImage) TransformColourProfile() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
// 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 {
|
||||
// Don't transform is there's no embedded profile
|
||||
if C.vips_has_embedded_icc(img.VipsImage) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -638,10 +638,6 @@ func (img *vipsImage) RemoveColourProfile() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (img *vipsImage) IsSRGB() bool {
|
||||
return img.VipsImage.Type == C.VIPS_INTERPRETATION_sRGB
|
||||
}
|
||||
|
||||
func (img *vipsImage) LinearColourspace() error {
|
||||
return img.Colorspace(C.VIPS_INTERPRETATION_scRGB)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user