From 73526facbcde758a12064d069783c559c3d01d9f Mon Sep 17 00:00:00 2001 From: elad laufer Date: Wed, 12 Jan 2022 12:44:40 +0100 Subject: [PATCH 1/3] - add golden --- ...d_ExtendBackground_Alpha-macos-12.golden.png | Bin 0 -> 26956 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 resources/png-8bit+alpha.Embed_ExtendBackground_Alpha-macos-12.golden.png diff --git a/resources/png-8bit+alpha.Embed_ExtendBackground_Alpha-macos-12.golden.png b/resources/png-8bit+alpha.Embed_ExtendBackground_Alpha-macos-12.golden.png new file mode 100644 index 0000000000000000000000000000000000000000..192b22248d6acab027897b61ec7461d79fc9a1f5 GIT binary patch literal 26956 zcmXV1by$>J6Gue_y@+%PNJ~pgOGt;bw9<{Vuq<#f2Z_IN&b+S8*cZi6H$TT%n4T*?uY!VS&J0iIS{7=oJ z+k(J9q^~v1{fLO}QW1Wx5q-*`Cn9=Cq^YW8{3Zvr2#&U%3Em7RW1~A)uHir}=lBf; z(6{HvUq>QiMr7z#A|Gx{-!vHV)OC;j$Ln#7rA{=NQ1sa=tz-31ba4jpNno3ASMyf=u8fV#T`0qBAu^wYw>0BD}q zHB!8RN-VeMa&OapjtLIiX@_+dgLQ}=d#=HnlCzvGG;wXAJY_z*_$&gs2t&yL<6EJW z-I61C9*4p0h`lu!G&}1C78Z0Kv>%GA$JSjVA}X*OF2+0Q7wuuUqg&%P9v?Fkouy(- zPZH8Gh_K}!qA4}tIDlLE3o((}BhLpl?wqCZ{XEW2P8|i{YNF>sf$_ofau6>*e8l6A zh(6#pB4SHOPk;Q0@19a!44u`GNpxWqCYm%kWj@W~Tng^+o4{;LAo_q~1BCJ4%lx=D zgD8)U;-Pa@;02=RbO*WFVc~fUNSJBh?5Khlu(h#{T2G(W=!^slMsw&K(ML{H_i3^2 z8|Zm%;scJ&S{GJDfQXNqte-u;PrwU8>E{sW^~VN%NEGoRbiJc?F_(KI3Q$eR7{<&z ztQgEfI8Bx@r5@8;ey$XMn60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+i-f9 zzt=zIWy|$W^DMIL;$p7HWepxB0BtHWHu1NMcA|nE|Gwq_fB3)H11D#MpZ}dV{Nvpq kJhgQ3|HW(gf40qwR3{5u{UmP1zc;O>nyxBB Date: Wed, 3 Aug 2022 17:28:37 +0200 Subject: [PATCH 2/3] - freeCString abstraction --- vips/color.go | 7 ++----- vips/header.go | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/vips/color.go b/vips/color.go index a0fbc608..def51aca 100644 --- a/vips/color.go +++ b/vips/color.go @@ -2,9 +2,6 @@ package vips // #include "color.h" import "C" -import ( - "unsafe" -) // Color represents an RGB type Color struct { @@ -80,11 +77,11 @@ func vipsICCTransform(in *C.VipsImage, outputProfile string, inputProfile string var cEmbedded C.gboolean cOutputProfile := C.CString(outputProfile) - defer C.free(unsafe.Pointer(cOutputProfile)) + defer freeCString(cOutputProfile) if inputProfile != "" { cInputProfile = C.CString(inputProfile) - defer C.free(unsafe.Pointer(cInputProfile)) + defer freeCString(cInputProfile) } if embedded { diff --git a/vips/header.go b/vips/header.go index 2d164015..f99b995d 100644 --- a/vips/header.go +++ b/vips/header.go @@ -100,7 +100,7 @@ func vipsSetPageHeight(in *C.VipsImage, height int) { func vipsImageGetMetaLoader(in *C.VipsImage) (string, bool) { var out *C.char - defer gFreePointer(unsafe.Pointer(out)) + defer freeCString(out) code := int(C.get_meta_loader(in, &out)) return C.GoString(out), code == 0 } From df634a6aa0d7dadc302aafc6bc4d2e6b8e85f3b3 Mon Sep 17 00:00:00 2001 From: elad laufer Date: Wed, 3 Aug 2022 17:50:32 +0200 Subject: [PATCH 3/3] When implicitly converting the image type (BMP to PNG), keep the original format available for query --- vips/foreign.go | 21 +++++++++++---------- vips/image.go | 32 ++++++++++++++++++++++---------- vips/image_test.go | 1 + 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/vips/foreign.go b/vips/foreign.go index 5e515523..a85edae5 100644 --- a/vips/foreign.go +++ b/vips/foreign.go @@ -252,36 +252,37 @@ func isJP2K(buf []byte) bool { return bytes.HasPrefix(buf, jp2kHeader) } -func vipsLoadFromBuffer(buf []byte, params *ImportParams) (*C.VipsImage, ImageType, error) { +func vipsLoadFromBuffer(buf []byte, params *ImportParams) (*C.VipsImage, ImageType, ImageType, error) { src := buf // Reference src here so it's not garbage collected during image initialization. defer runtime.KeepAlive(src) var err error - imageType := DetermineImageType(src) + originalType := DetermineImageType(src) + currentType := originalType - if imageType == ImageTypeBMP { + if originalType == ImageTypeBMP { src, err = bmpToPNG(src) if err != nil { - return nil, ImageTypeUnknown, err + return nil, currentType, originalType, err } - imageType = ImageTypePNG + currentType = ImageTypePNG } - if !IsTypeSupported(imageType) { + if !IsTypeSupported(currentType) { govipsLog("govips", LogLevelInfo, fmt.Sprintf("failed to understand image format size=%d", len(src))) - return nil, ImageTypeUnknown, ErrUnsupportedImageFormat + return nil, currentType, originalType, ErrUnsupportedImageFormat } - importParams := createImportParams(imageType, params) + importParams := createImportParams(currentType, params) if err := C.load_from_buffer(&importParams, unsafe.Pointer(&src[0]), C.size_t(len(src))); err != 0 { - return nil, ImageTypeUnknown, handleImageError(importParams.outputImage) + return nil, currentType, originalType, handleImageError(importParams.outputImage) } - return importParams.outputImage, imageType, nil + return importParams.outputImage, currentType, originalType, nil } func bmpToPNG(src []byte) ([]byte, error) { diff --git a/vips/image.go b/vips/image.go index 9ef2807f..5e3fe728 100644 --- a/vips/image.go +++ b/vips/image.go @@ -30,6 +30,7 @@ type ImageRef struct { buf []byte image *C.VipsImage format ImageType + originalFormat ImageType lock sync.Mutex preMultiplication *PreMultiplicationState optimizedIccProfile string @@ -412,12 +413,12 @@ func LoadImageFromBuffer(buf []byte, params *ImportParams) (*ImageRef, error) { params = NewImportParams() } - vipsImage, format, err := vipsLoadFromBuffer(buf, params) + vipsImage, currentFormat, originalFormat, err := vipsLoadFromBuffer(buf, params) if err != nil { return nil, err } - ref := newImageRef(vipsImage, format, buf) + ref := newImageRef(vipsImage, currentFormat, originalFormat, buf) govipsLog("govips", LogLevelDebug, fmt.Sprintf("created imageRef %p", ref)) return ref, nil @@ -447,7 +448,7 @@ func LoadThumbnailFromFile(file string, width, height int, crop Interesting, siz return nil, err } - ref := newImageRef(vipsImage, format, nil) + ref := newImageRef(vipsImage, format, format, nil) govipsLog("govips", LogLevelDebug, fmt.Sprintf("created imageref %p", ref)) return ref, nil @@ -467,7 +468,7 @@ func LoadThumbnailFromBuffer(buf []byte, width, height int, crop Interesting, si return nil, err } - ref := newImageRef(vipsImage, format, buf) + ref := newImageRef(vipsImage, format, format, buf) govipsLog("govips", LogLevelDebug, fmt.Sprintf("created imageref %p", ref)) return ref, nil @@ -492,7 +493,7 @@ func (r *ImageRef) Copy() (*ImageRef, error) { return nil, err } - return newImageRef(out, r.format, r.buf), nil + return newImageRef(out, r.format, r.originalFormat, r.buf), nil } // XYZ creates a two-band uint32 image where the elements in the first band have the value of their x coordinate @@ -515,13 +516,15 @@ func Black(width, height int) (*ImageRef, error) { return &ImageRef{image: vipsImage}, err } -func newImageRef(vipsImage *C.VipsImage, format ImageType, buf []byte) *ImageRef { +func newImageRef(vipsImage *C.VipsImage, currentFormat ImageType, originalFormat ImageType, buf []byte) *ImageRef { imageRef := &ImageRef{ - image: vipsImage, - format: format, - buf: buf, + image: vipsImage, + format: currentFormat, + originalFormat: originalFormat, + buf: buf, } runtime.SetFinalizer(imageRef, finalizeImage) + return imageRef } @@ -546,11 +549,19 @@ func (r *ImageRef) Close() { r.lock.Unlock() } -// Format returns the initial format of the vips image when loaded. +// Format returns the current format of the vips image. func (r *ImageRef) Format() ImageType { return r.format } +// OriginalFormat returns the original format of the image when loaded. +// In some cases the loaded image is converted on load, for example, a BMP is automatically converted to PNG +// This method returns the format of the original buffer, as opposed to Format() with will return the format of the +// currently held buffer content. +func (r *ImageRef) OriginalFormat() ImageType { + return r.originalFormat +} + // Width returns the width of this image. func (r *ImageRef) Width() int { return int(r.image.Xsize) @@ -1798,6 +1809,7 @@ func clearImage(ref *C.VipsImage) { type Coding int // Coding enum +//goland:noinspection GoUnusedConst const ( CodingError Coding = C.VIPS_CODING_ERROR CodingNone Coding = C.VIPS_CODING_NONE diff --git a/vips/image_test.go b/vips/image_test.go index 621597bc..7308b44f 100644 --- a/vips/image_test.go +++ b/vips/image_test.go @@ -145,6 +145,7 @@ func TestImageRef_BMP__ImplicitConversionToPNG(t *testing.T) { exported, metadata, err := img.ExportNative() assert.NoError(t, err) assert.Equal(t, ImageTypePNG, metadata.Format) + assert.Equal(t, ImageTypeBMP, img.OriginalFormat()) assert.NotNil(t, exported) }