Add getter, setter for MaxSize

This commit is contained in:
igsr5 2022-03-24 15:19:43 +09:00
parent 96a6384797
commit 1547c623a9
2 changed files with 25 additions and 5 deletions

View file

@ -564,7 +564,7 @@ func vipsExtract(image *C.VipsImage, left, top, width, height int) (*C.VipsImage
var buf *C.VipsImage
defer C.g_object_unref(C.gpointer(image))
if width > MaxSize || height > MaxSize {
if width > MaxSize() || height > MaxSize() {
return nil, errors.New("Maximum image size exceeded")
}
@ -581,7 +581,7 @@ func vipsSmartCrop(image *C.VipsImage, width, height int) (*C.VipsImage, error)
var buf *C.VipsImage
defer C.g_object_unref(C.gpointer(image))
if width > MaxSize || height > MaxSize {
if width > MaxSize() || height > MaxSize() {
return nil, errors.New("Maximum image size exceeded")
}