Skip to content

Commit

Permalink
add IMAGICK_NOT_EMPTY macro
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet committed Jun 1, 2023
1 parent 3cbbc56 commit 8feba80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions imagickdraw_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,7 @@ PHP_METHOD(ImagickDraw, composite)

intern = Z_IMAGICK_P(magick_obj);

if (php_imagick_ensure_not_empty (intern->magick_wand) == 0)
RETURN_THROWS();
IMAGICK_NOT_EMPTY (intern->magick_wand);

internd = Z_IMAGICKDRAW_P(getThis());
status = DrawComposite(internd->drawing_wand, compose, x, y, width, height, intern->magick_wand);
Expand Down
8 changes: 7 additions & 1 deletion php_imagick_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
#define IMAGICK_KERNEL_NOT_NULL_EMPTY(kernel) \
if (kernel->kernel_info == NULL) { \
zend_throw_exception(php_imagickkernel_exception_class_entry, "ImagickKernel is empty, cannot be used", (long)0 TSRMLS_CC); \
RETURN_NULL(); \
RETURN_THROWS(); \
}

#define IMAGICK_NOT_EMPTY(magick_wand) \
if (php_imagick_ensure_not_empty (magick_wand) == 0) { \
RETURN_THROWS(); \
}


#endif /* PHP_IMAGICK_MACROS_H */

0 comments on commit 8feba80

Please sign in to comment.