You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-27 22:48:53 +02:00
Fix handling ICC profiles with vips 8.15+
This commit is contained in:
20
vips/vips.go
20
vips/vips.go
@@ -736,6 +736,26 @@ func (img *Image) IsLinear() bool {
|
||||
return C.vips_image_guess_interpretation(img.VipsImage) == C.VIPS_INTERPRETATION_scRGB
|
||||
}
|
||||
|
||||
func (img *Image) BackupColourProfile() {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
if C.vips_icc_backup(img.VipsImage, &tmp) == 0 {
|
||||
C.swap_and_clear(&img.VipsImage, tmp)
|
||||
} else {
|
||||
log.Warningf("Can't backup ICC profile: %s", Error())
|
||||
}
|
||||
}
|
||||
|
||||
func (img *Image) RestoreColourProfile() {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
if C.vips_icc_restore(img.VipsImage, &tmp) == 0 {
|
||||
C.swap_and_clear(&img.VipsImage, tmp)
|
||||
} else {
|
||||
log.Warningf("Can't restore ICC profile: %s", Error())
|
||||
}
|
||||
}
|
||||
|
||||
func (img *Image) ImportColourProfile() error {
|
||||
var tmp *C.VipsImage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user