Skip to content

Commit

Permalink
Merge commit '54cdfe9d7aa58b819b203e235d39153d8e10b185'
Browse files Browse the repository at this point in the history
* commit '54cdfe9d7aa58b819b203e235d39153d8e10b185':
  add check for MagickSetImageInterpolateMethod

Fix FFT tests.
  • Loading branch information
Danack committed May 2, 2016
2 parents adf068c + 54cdfe9 commit 0ce9fac
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
8 changes: 8 additions & 0 deletions config.m4
Expand Up @@ -51,6 +51,14 @@ IM_FIND_IMAGEMAGICK([6.2.4], [$PHP_IMAGICK])
PHP_EVAL_LIBLINE($IM_IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD)
PHP_EVAL_INCLINE($IM_IMAGEMAGICK_CFLAGS)

old_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $IM_IMAGEMAGICK_LIBS"

PHP_CHECK_FUNC(MagickGetVersion)
PHP_CHECK_FUNC(MagickSetImageInterpolateMethod)

LDFLAGS=$old_LDFLAGS

PHP_SUBST(IMAGICK_SHARED_LIBADD)
AC_DEFINE(HAVE_IMAGICK,1,[ ])
PHP_NEW_EXTENSION(imagick, imagick_file.c imagick_class.c imagickdraw_class.c imagickpixel_class.c imagickpixeliterator_class.c imagick_helpers.c imagick.c imagickkernel_class.c shim_im6_to_im7.c, $ext_shared,, $IM_IMAGEMAGICK_CFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions imagick.c
Expand Up @@ -2287,7 +2287,9 @@ static zend_function_entry php_imagick_class_methods[] =
PHP_ME(imagick, setimageproperty, imagick_setimageproperty_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, deleteimageproperty, imagick_deleteimageproperty_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, identifyformat, imagick_identifyformat_args, ZEND_ACC_PUBLIC)
#ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD
PHP_ME(imagick, setimageinterpolatemethod, imagick_setimageinterpolatemethod_args, ZEND_ACC_PUBLIC)
#endif // #ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD
PHP_ME(imagick, getimageinterpolatemethod, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, linearstretchimage, imagick_linearstretchimage_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, getimagelength, imagick_zero_args, ZEND_ACC_PUBLIC)
Expand Down
2 changes: 2 additions & 0 deletions imagick_class.c
Expand Up @@ -1043,6 +1043,7 @@ PHP_METHOD(imagick, getimageinterpolatemethod)
}
/* }}} */

#ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD
/* {{{ proto bool Imagick::setImageInterpolateMethod(int method)
Sets the image interpolate pixel method.
*/
Expand Down Expand Up @@ -1071,6 +1072,7 @@ PHP_METHOD(imagick, setimageinterpolatemethod)
RETURN_TRUE;
}
/* }}} */
#endif // #ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD

/* {{{ proto bool Imagick::linearStretchImage(float blackPoint, float whitePoint)
Stretches with saturation the image intensity.
Expand Down
2 changes: 2 additions & 0 deletions php_imagick_defs.h
Expand Up @@ -438,7 +438,9 @@ PHP_METHOD(imagick, getimageproperty);
PHP_METHOD(imagick, setimageproperty);
PHP_METHOD(imagick, deleteimageproperty);
PHP_METHOD(imagick, identifyformat);
#ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD
PHP_METHOD(imagick, setimageinterpolatemethod);
#endif // #ifdef HAVE_MAGICKSETIMAGEINTERPOLATEMETHOD
PHP_METHOD(imagick, getimageinterpolatemethod);
PHP_METHOD(imagick, linearstretchimage);
PHP_METHOD(imagick, getimagelength);
Expand Down
4 changes: 2 additions & 2 deletions tests/073_Imagick_forwardFourierTransformImage_basic.phpt
Expand Up @@ -42,10 +42,10 @@ function forwardFourierTransformImage() {
$mask = createMask();
$imagick->forwardFourierTransformImage(true);

@$imagick->setimageindex(0);
$imagick->setIteratorIndex(0);
$magnitude = $imagick->getimage();

@$imagick->setimageindex(1);
$imagick->setIteratorIndex(1);
$imagickPhase = $imagick->getimage();

if (true) {
Expand Down
4 changes: 2 additions & 2 deletions tests/086_Imagick_forwardFourierTransformImage_basic.phpt
Expand Up @@ -39,10 +39,10 @@ function forwardFourierTransformImage() {
$mask = createMask();
$imagick->forwardFourierTransformImage(true);

@$imagick->setimageindex(0);
$imagick->setIteratorIndex(0);
$magnitude = $imagick->getimage();

@$imagick->setimageindex(1);
$imagick->setIteratorIndex(1);
$imagickPhase = $imagick->getimage();

if (true) {
Expand Down
14 changes: 8 additions & 6 deletions tests/268_ImagickDraw_getDensity_basic.phpt
Expand Up @@ -24,9 +24,15 @@ $draw->setFontSize(72);

$opacityToSet = 0.1;

$density = $draw->getDensity();
$densitySet = "200";

// What to test for density?

$draw->setDensity($densitySet);
$densityGet = $draw->getDensity();

if (strcmp($densitySet, $densityGet) !== 0) {
echo "Density retrieved [$densityGet] is not the value set [$densitySet].";
}

$draw->line(125, 70, 100, 50);
$draw->line(350, 170, 100, 150);
Expand All @@ -36,13 +42,9 @@ $imagick->newImage(500, 500, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);




$bytes = $imagick->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}

echo "This test is not working yet.";
?>
--EXPECTF--
Ok

0 comments on commit 0ce9fac

Please sign in to comment.