Skip to content

Commit

Permalink
Update GetImageBlob/GetImagesBlob to return blob when ExceptionInfo i…
Browse files Browse the repository at this point in the history
…s warning kind (#328)

Co-authored-by: hejingzheng <hejingzheng@01.ai>
  • Loading branch information
kfxhjz and hejingzheng authored Sep 25, 2024
1 parent 0c141b9 commit 9653766
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions imagick/magick_wand_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,11 @@ func (mw *MagickWand) GetImageBlob() ([]byte, error) {
clen := C.size_t(0)
csblob := C.MagickGetImageBlob(mw.mw, &clen)
defer relinquishMemory(unsafe.Pointer(csblob))
if err := mw.GetLastError(); err != nil {
return nil, err
}
ret := C.GoBytes(unsafe.Pointer(csblob), C.int(clen))
runtime.KeepAlive(mw)
if err := mw.GetLastError(); err != nil {
return ret, err
}
return ret, nil
}

Expand All @@ -959,11 +959,11 @@ func (mw *MagickWand) GetImagesBlob() ([]byte, error) {
clen := C.size_t(0)
csblob := C.MagickGetImagesBlob(mw.mw, &clen)
defer relinquishMemory(unsafe.Pointer(csblob))
if err := mw.GetLastError(); err != nil {
return nil, err
}
ret := C.GoBytes(unsafe.Pointer(csblob), C.int(clen))
runtime.KeepAlive(mw)
if err := mw.GetLastError(); err != nil {
return ret, err
}
return ret, nil
}

Expand Down

0 comments on commit 9653766

Please sign in to comment.