mirror of
https://github.com/Imagick/imagick.git
synced 2026-06-19 07:35:36 +00:00
Imagick::profileImage() fix to allow null as second parameter again.
Fixed #456
This commit is contained in:
+1
-1
@@ -1040,7 +1040,7 @@ class Imagick
|
||||
// PREVIEW_*
|
||||
public function previewImages(int $preview): bool {}
|
||||
|
||||
public function profileImage(string $name, string $profile): bool {}
|
||||
public function profileImage(string $name, ?string $profile): bool {}
|
||||
|
||||
public function quantizeImage(
|
||||
int $number_colors,
|
||||
|
||||
+21
-2
@@ -4223,7 +4223,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_profileImage, 0, 0, 2)
|
||||
#endif
|
||||
|
||||
#if PHP_VERSION_ID >= 80000
|
||||
ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 0)
|
||||
ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 1)
|
||||
#else
|
||||
ZEND_ARG_INFO(0, profile)
|
||||
#endif
|
||||
@@ -4470,7 +4470,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageInterlaceScheme, 0, 0, 1)
|
||||
#endif
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_Imagick_setImageProfile arginfo_class_Imagick_profileImage
|
||||
|
||||
#if PHP_VERSION_ID >= 80000
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 2, _IS_BOOL, 0)
|
||||
#else
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageProfile, 0, 0, 2)
|
||||
#endif
|
||||
|
||||
|
||||
#if PHP_VERSION_ID >= 80000
|
||||
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
|
||||
#else
|
||||
ZEND_ARG_INFO(0, name)
|
||||
#endif
|
||||
|
||||
#if PHP_VERSION_ID >= 80000
|
||||
ZEND_ARG_TYPE_INFO(0, profile, IS_STRING, 0)
|
||||
#else
|
||||
ZEND_ARG_INFO(0, profile)
|
||||
#endif
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_class_Imagick_setImageRedPrimary arginfo_class_Imagick_setImageBluePrimary
|
||||
|
||||
|
||||
+2
-2
@@ -5085,7 +5085,7 @@ PHP_METHOD(Imagick, previewImages)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool Imagick::profileImage(string name,string profile)
|
||||
/* {{{ proto bool Imagick::profileImage(string name, string|null profile)
|
||||
Adds or removes a ICC, IPTC, or generic profile from an image. If the profile is NULL, it is removed from the image otherwise added. Use a name of '*' and a profile of NULL to remove all profiles from the image.
|
||||
*/
|
||||
PHP_METHOD(Imagick, profileImage)
|
||||
@@ -5096,7 +5096,7 @@ PHP_METHOD(Imagick, profileImage)
|
||||
MagickBooleanType status;
|
||||
|
||||
/* Parse parameters given to function */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &profile, &profile_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss!", &name, &name_len, &profile, &profile_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -351,6 +351,7 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.
|
||||
<file name="287_Imagick_GetImageChannelRange_basic.phpt" role="test" />
|
||||
<file name="288_imagick_prevent_zero_size_images.phpt" role="test" />
|
||||
<file name="289_Imagick_setImageMask_basic.phpt" role="test" />
|
||||
<file name="290_imagick_profileimage.phpt" role="test" />
|
||||
<file name="bug20636.phpt" role="test" />
|
||||
<file name="bug21229.phpt" role="test" />
|
||||
<file name="bug59378.phpt" role="test" />
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Imagick::profileImage test
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$imagick = new Imagick();
|
||||
$imagick->newPseudoImage(640, 480, "magick:logo");
|
||||
$imagick->profileImage('*', null);
|
||||
|
||||
echo "Ok";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Ok
|
||||
Reference in New Issue
Block a user