Projects
home:rottame:vhosts-ng:php8-extensions
php8-imagick
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
php8-imagick.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 19 14:12:16 UTC 2025 - Angelo Grossini <angelo@intercom.it> + +- update to 3.8.0 + +------------------------------------------------------------------- Wed Aug 16 12:45:11 UTC 2023 - Angelo Grossini <rottame@intercom.it> - vhng versioning
View file
php8-imagick.spec
Changed
@@ -17,7 +17,7 @@ %define pkg_name imagick Name: php8-%{pkg_name} -Version: 3.7.0 +Version: 3.8.0 Release: lp151.25.1 Summary: Wrapper to the ImageMagick library License: PHP-3.01
View file
imagick-3.7.0.tgz/imagick-3.7.0/ChangeLog
Deleted
@@ -1,1156 +0,0 @@ -3.7.0 -- Added: - * Imagick::COMPOSITE_SALIENCY_BLEND - -3.7.0RC1 -- Added: - * function Imagick::deleteOption(string $option): bool {} - * function Imagick::getBackgroundColor(): ImagickPixel {} - * function Imagick::getImageArtifacts(string $pattern = "*"): array {} - * function Imagick::getImageKurtosis(): array {} - * function Imagick::getImageMean(): array {} - * function Imagick::getImageRange(): array {} - * function Imagick::getInterpolateMethod(): int {} - * function Imagick::getOptions(string $pattern = "*"): array {} - * function Imagick::getOrientation(): int {} - * function Imagick::getResolution(): array {} - * function Imagick::getType(): int {} - * function Imagick::implodeImageWithMethod(float $radius, int $pixel_interpolate_method): bool {} - * function Imagick::oilPaintImageWithSigma(float $radius, float $sigma) - * function Imagick::polaroidWithTextAndMethod(ImagickDraw $settings, float $angle, string $caption, int $method): bool {} - * function Imagick::polynomialImage(array $terms): bool {} - * function Imagick::setDepth(int $depth): bool {} - * function Imagick::setExtract(string $geometry): bool {} - * function Imagick::setInterpolateMethod(int $method): bool{} - * function Imagick::setOrientation(int $orientation): bool {} - * function Imagick::spreadImageWithMethod(float $radius, int $interpolate_method): bool {} - * function Imagick::swirlImageWithMethod(float $degrees, int $interpolate_method): bool {} - * function Imagick::waveImageWithMethod(float $amplitude, float $length, int $interpolate_method): bool {} - * Imagick::IMAGE_TYPE_BILEVEL - * Imagick::IMAGE_TYPE_GRAYSCALE - * Imagick::IMAGE_TYPE_GRAYSCALE_ALPHA - * Imagick::IMAGE_TYPE_PALETTE - * Imagick::IMAGE_TYPE_PALETTE_ALPHA - * Imagick::IMAGE_TYPE_TRUE_COLOR - * Imagick::IMAGE_TYPE_TRUE_COLOR_ALPHA - * Imagick::IMAGE_TYPE_COLOR_SEPARATION - * Imagick::IMAGE_TYPE_COLOR_SEPARATION_ALPHA - * Imagick::IMAGE_TYPE_OPTIMIZE - * Imagick::IMAGE_TYPE_PALETTE_BILEVEL_ALPHA - * Imagick::COMPOSITE_SEAMLESS_BLEND -- Changed: - * Imagick::setImageArtifact can now take null for the string value. - * Return type for Imagick::getImageArtifact is string|null instead of string. - -3.6.0 - - No change from 3.6.0RC2 - -3.6.0RC2 -- Fixes: - * Remove deprecated message from Imagick::roundCorners() -- Added: - * Imagick::addNoiseImageWithAttenuate() - -3.6.0RC1 - - Imagick::getImageInterlaceScheme is undeprecated. It's the appropriate function to call to get the image interlace setting. - - Image formats are now normalised to lower case. - - Imagick::getImageIndex and Imagick::setImageIndex are undeprecated and work on ImageMagick 7. They call MagickGetIteratorIndex and MagickSetIteratorIndex internally. - - Imagick::averageImages is undeprecated. For IM 7 it now calls EvaluateImages(wand->images,MeanEvaluateOperator). - - Imagick::flattenImages is undeprecated. For IM 7 it now calls MagickMergeImageLayers(intern->magick_wand, FlattenLayer); internally. - - Imagick::getImageSize is undeprecated. For IM 7 it now calls MagickGetImageLength internally. - - Imagick::roundCornersImage is undeprecated and available on IM7. -- Fixes: - * Imagick::borderImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::borderImageWithComposite() instead, which allows you to set the composite method. - * Imagick::frameImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::frameImageWithComposite() instead, which allows you to set the composite method. - * Imagick::profileImage() fixed to allow null as second paramter again. If you can't upgrade to this version yet, pass in "", which has the same effect. - * Imagick::ALPHACHANNEL_COPY and Imagick::ALPHACHANNEL_OPAQUE should be available on IM7. - * Imagick::setImageMatteColor() should be available on IM7. -- Added: - * Imagick::borderImageWithComposite() same as Imagick::borderImage() but allows user to set composite operator used. - * Imagick::frameImageWithComposite() same as Imagick::frameImage() but allows user to set composite operator used. - * function Imagick::cannyEdgeImage - * function Imagick::setSeed - * function Imagick::waveletDenoiseImage - * function Imagick::meanShiftImage - * function Imagick::kmeansImage - * function Imagick::rangeThresholdImage - * function Imagick::autoThresholdImage - * function Imagick::bilateralBlurImage - * function Imagick::claheImage - * function Imagick::channelFxImage - * function Imagick::colorThresholdImage - * function Imagick::complexImages - * function Imagick::interpolativeResizeImage - * function Imagick::levelImageColors - * function Imagick::levelizeImage - * function Imagick::orderedDitherImage - * function Imagick::whiteBalanceImage - -3.5.1 - - No change from 3.5.1RC1 - -3.5.1RC1 - - Better detection of appropriate OpenMP library to use, i.e. GCC or Clang. - -3.5.0 - - Correct parameter for ImagickPixel::getColorValue and ImagickPixel::setIndex. - -3.5.0RC2 - - Fix incorrect parameter defaults, and small fixes on arginfo generation. - -3.5.0RC1 -- ImageMagick 7 is still not widely available on systems. So contrary to previous plans, ImageMagick 6 support will continue for now, but users are recommended to use ImageMagick 7 if possible. -- Method names have been changed to not be all lower case. Both method names and parameter information is built from the Imagick*.stub.php files. -- Prevent accidental creation of zero dimension images. ImageMagick doesn't prevent creation of zero dimension images, but will give an error when that image is used. I don't think this will affect any correctly program, but if it does, and you need to re-enable zero dimension images, please open an issue at https://phpimagick.com/issues -- Various pieces of work have been done to make GOMP not segfault including: - * Call omp_pause_resource_all when available during shutdown. - * Added the 'imagick.shutdown_sleep_count' (default 10) and 'imagick.set_single_thread' (default On). Both of these exist to mitigate the segaults on shutdown. -- Fixes: - * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x - * Imagick::morphology now no longer ignores channel parameter -- Added: - * PHP 8.0 support. - * Location check for ImageMagick 7 for NixOS and Brew. - * Imagick::houghLineImage(int $width, int $height, float $threshold): bool {} - * Imagick::setImagePixelColor(int $x, int $y, ImagickPixel|string $color) - * Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) - * Imagick::getImageMask(int $pixelmask_type) - * Imagick::VIRTUALPIXELMETHOD_DITHER - * Imagick::VIRTUALPIXELMETHOD_RANDOM - * Imagick::COMPOSITE_FREEZE - * Imagick::COMPOSITE_INTERPOLATE - * Imagick::COMPOSITE_NEGATE - * Imagick::COMPOSITE_REFLECT - * Imagick::COMPOSITE_SOFTBURN - * Imagick::COMPOSITE_SOFTDODGE - * Imagick::COMPOSITE_STAMP - * Imagick::COMPOSITE_RMSE - * Imagick::COMPRESSION_DWAA - * Imagick::COMPRESSION_DWAB - * Imagick::EVALUATE_INVERSE_LOG - * Imagick::COLORSPACE_DISPLAYP3 - * Imagick::COLORSPACE_ADOBE98 - * Imagick::COLORSPACE_PROPHOTO - * Imagick::COLORSPACE_JZAZBZ - * Imagick::DISTORTION_RIGID_AFFINE - * Imagick::DISTORTION_BARRELINVERSE - * Imagick::STATISTIC_ROOT_MEAN_SQUARE - -3.4.4 -- Fixes: - * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x - -3.4.4RC2 -- Fixes: - * Correct stability for RC release - * Fix undefined variable for ZTS build - -3.4.4RC1 -- The 3.4.4 release is intended to be the last release (other than small bug fixes) that will support either PHP 5.x, or ImageMagick 6.x. The next planned release will be PHP > 7.0 and ImageMagick > 7.0 at least, if not higher. -- Added: - * function Imagick::optimizeImageTransparency() - * METRIC_STRUCTURAL_SIMILARITY_ERROR - * METRIC_STRUCTURAL_DISSIMILARITY_ERROR - * COMPRESSION_ZSTD - https://github.com/facebook/zstd - * COMPRESSION_WEBP - * CHANNEL_COMPOSITE_MASK - * FILTER_CUBIC_SPLINE - "Define the lobes with the -define filter:lobes={2,3,4} (reference https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=32506)." - * Imagick now explicitly conflicts with the Gmagick extension. -- Fixes: - * Bug 77128 - Imagick::setImageInterpolateMethod() not available on Windows - * Prevent memory leak when ImagickPixel::__construct called after object instantiation. - * Prevent segfault when ImagickPixel internal constructor not called. - * Imagick::setResourceLimit support for values larger than 2GB (2^31) on 32bit platforms. - * Corrected memory overwrite in Imagick::colorDecisionListImage() - * Bug 77791 - ImagickKernel::fromMatrix() out of bounds write. -- Deprecated: - * The following functions have been deprecated: - ImagickDraw, matte - Imagick::averageimages - Imagick::colorfloodfillimage - Imagick::filter - Imagick::flattenimages - Imagick::getimageattribute - Imagick::getimagechannelextrema - Imagick::getimageclipmask - Imagick::getimageextrema - Imagick::getimageindex - Imagick::getimagematte - Imagick::getimagemattecolor - Imagick::getimagesize - Imagick::mapimage - Imagick::mattefloodfillimage - Imagick::medianfilterimage - Imagick::mosaicimages - Imagick::orderedposterizeimage - Imagick::paintfloodfillimage - Imagick::paintopaqueimage - Imagick::painttransparentimage - Imagick::radialblurimage - Imagick::recolorimage - Imagick::reducenoiseimage - Imagick::roundcornersimage - Imagick::roundcorners - Imagick::setimageattribute - Imagick::setimagebias - Imagick::setimageclipmask - Imagick::setimageindex - Imagick::setimagemattecolor - Imagick::setimagebiasquantum
View file
imagick-3.7.0.tgz/imagick-3.7.0/Imagick.stub.php
Deleted
@@ -1,1649 +0,0 @@ -<?php - -/** @generate-function-entries */ - -class Imagick -{ -#if MagickLibVersion > 0x628 - public function optimizeImageLayers(): bool {} - - // METRIC_* - public function compareImageLayers(int $metric): Imagick {} - - public function pingImageBlob(string $image): bool {} - - // $filehandle should be a resource, but that is a pseudo-type - // which causes problems for people trying to mock the class - public function pingImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} - - public function transposeImage(): bool {} - - public function transverseImage(): bool {} - - public function trimImage(float $fuzz): bool {} - - public function waveImage(float $amplitude, float $length): bool {} - -#if MagickLibVersion >= 0x700 - public function waveImageWithMethod( - float $amplitude, - float $length, - int $interpolate_method // INTERPOLATE_* - ): bool {} -#endif - - public function vignetteImage(float $black_point, float $white_point, int $x, int $y): bool {} - - public function uniqueImageColors(): bool {} - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion < 0x700 -// PHP_ME(imagick, getimagematte, imagick_zero_args, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) - /** @deprecated */ - public function getImageMatte(): bool {} -#endif -#endif - - // TODO - enabled? - public function setImageMatte(bool $matte): bool {} - - public function adaptiveResizeImage( - int $columns, - int $rows, - bool $bestfit = false, - bool $legacy = false): bool {} - - public function sketchImage(float $radius, float $sigma, float $angle): bool {} - - public function shadeImage(bool $gray, float $azimuth, float $elevation): bool {} - - public function getSizeOffset(): int {} - - public function setSizeOffset(int $columns, int $rows, int $offset): bool {} - - - public function adaptiveBlurImage( - float $radius, - float $sigma, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function contrastStretchImage( - float $black_point, - float $white_point, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - public function adaptiveSharpenImage( - float $radius, - float $sigma, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - - public function randomThresholdImage( - float $low, - float $high, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} - - - - public function roundCornersImage( - float $x_rounding, - float $y_rounding, - float $stroke_width = 10, - float $displace = 5, - float $size_correction = -6): bool {} - - /** - * @alias Imagick::roundCornersImage - */ - public function roundCorners( - float $x_rounding, - float $y_rounding, - float $stroke_width = 10, - float $displace = 5, - float $size_correction = -6): bool {} - - public function setIteratorIndex(int $index): bool {} - - public function getIteratorIndex(): int {} - -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function transformImage(string $crop, string $geometry): Imagick {} -#endif -#endif - -#if MagickLibVersion > 0x630 -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function setImageOpacity(float $opacity): bool {} -#endif - -#if MagickLibVersion >= 0x700 - public function setImageAlpha(float $alpha): bool {} -#endif - -#if MagickLibVersion < 0x700 - - /** @deprecated */ - public function orderedPosterizeImage( - string $threshold_map, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif -#endif - -#if MagickLibVersion >= 0x700 - public function polaroidWithTextAndMethod( - ImagickDraw $settings, - float $angle, - string $caption, - int $method - ): bool {} -#endif - -#if MagickLibVersion > 0x631 - - public function polaroidImage(ImagickDraw $settings, float $angle): bool {} - - public function getImageProperty(string $name): string {} - - public function setImageProperty(string $name, string $value): bool {} - - public function deleteImageProperty(string $name): bool {} - - // Replaces any embedded formatting characters with the appropriate - // image property and returns the interpreted text. - // See http://www.imagemagick.org/script/escape.php for escape sequences. - // -format "%m:%f %wx%h" - public function identifyFormat(string $format): string {} - - -#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD - // INTERPOLATE_* - public function setImageInterpolateMethod(int $method): bool {} -#endif - - // why does this not need to be inside the 'if' for IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD ..? - public function getImageInterpolateMethod(): int {} - - public function linearStretchImage(float $black_point, float $white_point): bool {} - - public function getImageLength(): int {} - - public function extentImage(int $width, int $height, int $x, int $y): bool {} -#endif -#if MagickLibVersion > 0x633 - public function getImageOrientation(): int {} - - public function setImageOrientation(int $orientation): bool {} -#endif - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) -#if MagickLibVersion > 0x634 -#if MagickLibVersion < 0x700 - /** @deprecated */ - public function paintFloodfillImage( - ImagickPixel|string $fill_color, - float $fuzz, - ImagickPixel|string $border_color, - int $x, - int $y, - int $channel = Imagick::CHANNEL_DEFAULT - ): bool {} -#endif -#endif -#endif
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickDraw.stub.php
Deleted
@@ -1,408 +0,0 @@ -<?php - -/** @generate-function-entries */ -class ImagickDraw -{ -#if MagickLibVersion > 0x628 - public function resetVectorGraphics(): bool {} -#endif -#if MagickLibVersion > 0x649 - public function getTextKerning(): float {} - public function setTextKerning(float $kerning): bool {} - public function getTextInterwordSpacing(): float {} - - public function setTextInterwordSpacing(float $spacing): bool {} -#endif -#if MagickLibVersion > 0x655 - public function getTextInterlineSpacing(): float {} - public function setTextInterlineSpacing(float $spacing): bool {} -#endif - - public function __construct() {} - - public function setFillColor(ImagickPixel|string $fill_color): bool {} - - public function setFillAlpha(float $alpha): bool {} - - public function setResolution(float $resolution_x, float $resolution_y): bool {} - - public function setStrokeColor(ImagickPixel|string $color): bool {} - - public function setStrokeAlpha(float $alpha): bool {} - - public function setStrokeWidth(float $width): bool {} - - public function clear(): bool {} - - public function circle( - float $origin_x, - float $origin_y, - float $perimeter_x, - float $perimeter_y - ): bool {} - - public function annotation(float $x, float $y, string $text): bool {} - - public function setTextAntialias(bool $antialias): bool {} - - public function setTextEncoding(string $encoding): bool {} - - public function setFont(string $font_name): bool {} - - public function setFontFamily(string $font_family): bool {} - - public function setFontSize(float $point_size): bool {} - - // STYLE_* - public function setFontStyle(int $style): bool {} - - /** - * $weight font weight (valid range 100-900) - */ - public function setFontWeight(int $weight): bool {} - - public function getFont(): string {} - - public function getFontFamily(): string {} - - public function getFontSize(): float {} - - public function getFontStyle(): int {} - - public function getFontWeight(): int {} - - /** @alias ImagickDraw::clear */ - public function destroy(): bool {} - - public function rectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y): bool {} - - public function roundRectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y, float $rounding_x, float $rounding_y): bool {} - - - //ox - //origin x ordinate - //oy - //origin y ordinate - //rx - //radius in x - //ry - //radius in y - //start - //starting rotation in degrees - //end - //ending rotation in degrees - - public function ellipse(float $origin_x, float $origin_y, float $radius_x, float $radius_y, float $angle_start, float $angle_end): bool {} - - public function skewX(float $degrees): bool {} - - public function skewY(float $degrees): bool {} - - public function translate(float $x, float $y): bool {} - - public function line(float $start_x, float $start_y, float $end_x, float $end_y): bool {} - - -//sx -//starting x ordinate of bounding rectangle -//sy -//starting y ordinate of bounding rectangle -//ex -//ending x ordinate of bounding rectangle -//ey -//ending y ordinate of bounding rectangle -//sd -//starting degrees of rotation -//ed -//ending degrees of rotation - - public function arc( - float $start_x, - float $start_y, - float $end_x, - float $end_y, - float $start_angle, - float $end_angle - ): bool {} - -#if MagickLibVersion >= 0x700 - // PAINT_* - public function alpha(float $x, float $y, int $paint): bool {} -#else - /** @deprecated */ - // PAINT_* - public function matte(float $x, float $y, int $paint): bool {} -#endif - - public function polygon(array $coordinates): bool {} - - public function point(float $x, float $y): bool {} - - public function getTextDecoration(): int {} - - public function getTextEncoding(): string {} - - public function getFontStretch(): int {} - - // STRETCH_* font_stretch - public function setFontStretch(int $stretch): bool {} - - public function setStrokeAntialias(bool $enabled): bool {} - - // ALIGN_* - public function setTextAlignment(int $align): bool {} - - // DECORATION_* - public function setTextDecoration(int $decoration): bool {} - - public function setTextUnderColor(ImagickPixel|string $under_color): bool {} - - public function setViewbox(int $left_x, int $top_y, int $right_x, int $bottom_y): bool {} - - public function clone(): ImagickDraw {} - - public function affine(array $affine): bool {} - - public function bezier(array $coordinates): bool {} - - // COMPOSITE_* - public function composite( - int $composite, - float $x, - float $y, - float $width, - float $height, - Imagick $image - ): bool {} - - // PAINT_* - public function color(float $x, float $y, int $paint): bool {} - - public function comment(string $comment): bool {} - - public function getClipPath(): string {} - - public function getClipRule(): int {} - - public function getClipUnits(): int {} - - public function getFillColor(): ImagickPixel {} - - public function getFillOpacity(): float {} - - public function getFillRule(): int {} - - public function getGravity(): int {} - - public function getStrokeAntialias(): bool {} - - public function getStrokeColor(): ImagickPixel {}
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickDraw_arginfo.h
Deleted
@@ -1,1947 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, kerning, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, kerning) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x649 -#define arginfo_class_ImagickDraw_getTextInterwordSpacing arginfo_class_ImagickDraw_getTextKerning -#endif - -#if MagickLibVersion > 0x649 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, spacing) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x655 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, spacing) -#endif -ZEND_END_ARG_INFO() -#endif - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw___construct, 0, 0, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, alpha) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, resolution_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, resolution_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, resolution_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, resolution_y) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickDraw_setStrokeAlpha arginfo_class_ImagickDraw_setFillAlpha - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, width) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, origin_y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, perimeter_x, IS_DOUBLE, 0)
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickKernel.stub.php
Deleted
@@ -1,25 +0,0 @@ -<?php - -/** @generate-function-entries */ - -#ifdef IMAGICK_WITH_KERNEL -class ImagickKernel -{ - public function addKernel(ImagickKernel $kernel): void {} - - public function addUnityKernel(float $scale): void {} - - // KERNEL_* - public static function fromBuiltin(int $kernel, string $shape): ImagickKernel {} - - public static function fromMatrix(array $matrix, ?array $origin): ImagickKernel {} - - public function getMatrix(): array {} - - // NORMALIZE_KERNEL_ - public function scale(float $scale, ?int $normalize_kernel = null): void {} - - public function separate(): array {} -} -#endif -
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickKernel_arginfo.h
Deleted
@@ -1,166 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, scale) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 2, ImagickKernel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, kernel, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, kernel) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, shape, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, shape) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 2, ImagickKernel, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) -#else - ZEND_ARG_INFO(0, matrix) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, origin, IS_ARRAY, 1) -#else - ZEND_ARG_INFO(0, origin) -#endif -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 1, IS_VOID, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, scale) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalize_kernel, IS_LONG, 1, "null") -#else - ZEND_ARG_INFO(0, normalize_kernel) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if defined(IMAGICK_WITH_KERNEL) -#define arginfo_class_ImagickKernel_separate arginfo_class_ImagickKernel_getMatrix -#endif - - -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, addKernel); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, addUnityKernel); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, fromBuiltin); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, fromMatrix); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, getMatrix); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, scale); -#endif -#if defined(IMAGICK_WITH_KERNEL) -ZEND_METHOD(ImagickKernel, separate); -#endif - - -static const zend_function_entry class_ImagickKernel_methods = { -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, addKernel, arginfo_class_ImagickKernel_addKernel, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, addUnityKernel, arginfo_class_ImagickKernel_addUnityKernel, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, fromBuiltin, arginfo_class_ImagickKernel_fromBuiltin, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, fromMatrix, arginfo_class_ImagickKernel_fromMatrix, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, getMatrix, arginfo_class_ImagickKernel_getMatrix, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, scale, arginfo_class_ImagickKernel_scale, ZEND_ACC_PUBLIC) -#endif -#if defined(IMAGICK_WITH_KERNEL) - ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC) -#endif - ZEND_FE_END -}; \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixel.stub.php
Deleted
@@ -1,83 +0,0 @@ -<?php - -/** @generate-function-entries */ - -class ImagickPixel -{ - public function __construct(?string $color = null) {} - - public function clear(): bool {} - - /** @alias ImagickPixel::clear */ - public function destroy(): bool {} - - public function getColor(int $normalized = 0): array {} - - public function getColorAsString(): string {} - - public function getColorCount(): int {} - - public function getColorQuantum(): array {} - - // COLOR_* - public function getColorValue(int $color): float {} - - /** - * $color // COLOR_* - * return - * - Float if IM compiled with HDRI - * - int if IM compiled with fixed point math - */ - public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {} - - public function getHSL(): array {} - - public function getIndex(): int {} - - public function isPixelSimilar(ImagickPixel|string $color, float $fuzz): bool {} - - // The fuzz value should be in the range 0-QuantumRange. The maximum value - // represents the longest possible distance in the colorspace. e.g. from - // RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace - public function isPixelSimilarQuantum(ImagickPixel|string $color, float $fuzz_quantum_range_scaled_by_square_root_of_three): bool {} - - /** @alias ImagickPixel::isPixelSimilarQuantum */ - - public function isSimilar( - ImagickPixel|string $color, - // Feel free to not use named params for this. - float $fuzz_quantum_range_scaled_by_square_root_of_three - ): bool{} - - public function setColor(string $color): bool {} - - public function setColorCount(int $color_count): bool {} - - // COLOR_* - public function setColorValue(int $color, float $value): bool {} - - /** - * $color // COLOR_* - * $value - * - * Type of value depends on how ImageMagick was compiled. - * - Float if IM compiled with HDRI - * - int if IM compiled with fixed point math - * - */ - public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{} - - public function setHSL(float $hue, float $saturation , float $luminosity): bool{} - - // This function could be described more clearly... - // https://imagemagick.org/api/pixel-wand.php#PixelSetIndex - public function setIndex(IMAGICK_QUANTUM_TYPE $index): bool {} - - //// Not in docs. -#if MagickLibVersion >= 0x693 - public function setColorFromPixel(ImagickPixel $pixel): bool {} -#endif -} - - -
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixelIterator.stub.php
Deleted
@@ -1,66 +0,0 @@ -<?php - -/** @generate-function-entries */ -class ImagickPixelIterator { - public function __construct(Imagick $imagick) {} - - public function clear(): bool {} - - public static function getPixelIterator(Imagick $imagick) : ImagickPixelIterator {} - - public static function getPixelRegionIterator( - Imagick $imagick, - int $x, - int $y, - int $columns, - int $rows): ImagickPixelIterator {} - - - /** @alias ImagickPixelIterator::clear */ - public function destroy(): bool {} - - public function getCurrentIteratorRow(): array {} - - public function getIteratorRow(): int {} - - public function getNextIteratorRow(): array {} - - public function getPreviousIteratorRow(): array {} - - /** @alias ImagickPixelIterator::getIteratorRow */ - public function key(): int {} - - /** @alias ImagickPixelIterator::getNextIteratorRow - * @tentative-return-type - */ - public function next(): void {} - - /** @alias ImagickPixelIterator::resetIterator - * @tentative-return-type - */ - public function rewind(): void {} - - /** @alias ImagickPixelIterator::getCurrentIteratorRow */ - public function current(): array {} - - public function newPixelIterator(Imagick $imagick): bool {} - - public function newPixelRegionIterator( - Imagick $imagick, - int $x, - int $y, - int $columns, - int $rows): bool {} - - public function resetIterator(): bool {} - - public function setIteratorFirstRow(): bool {} - - public function setIteratorLastRow(): bool {} - - public function setIteratorRow(int $row): bool {} - - public function syncIterator(): bool {} - - public function valid(): bool {} -}
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixelIterator_arginfo.h
Deleted
@@ -1,206 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 1, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 5, ImagickPixelIterator, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_destroy arginfo_class_ImagickPixelIterator_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_getNextIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - -#define arginfo_class_ImagickPixelIterator_getPreviousIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - -#define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow - -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next - -#define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 0, 1) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 5, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 0, 5) -#endif - - ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, columns) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, rows) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_resetIterator arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_setIteratorFirstRow arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_setIteratorLastRow arginfo_class_ImagickPixelIterator_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, row, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, row) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixelIterator_syncIterator arginfo_class_ImagickPixelIterator_clear - -#define arginfo_class_ImagickPixelIterator_valid arginfo_class_ImagickPixelIterator_clear - - -ZEND_METHOD(ImagickPixelIterator, __construct); -ZEND_METHOD(ImagickPixelIterator, clear); -ZEND_METHOD(ImagickPixelIterator, getPixelIterator); -ZEND_METHOD(ImagickPixelIterator, getPixelRegionIterator); -ZEND_METHOD(ImagickPixelIterator, getCurrentIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getNextIteratorRow); -ZEND_METHOD(ImagickPixelIterator, getPreviousIteratorRow); -ZEND_METHOD(ImagickPixelIterator, resetIterator); -ZEND_METHOD(ImagickPixelIterator, newPixelIterator); -ZEND_METHOD(ImagickPixelIterator, newPixelRegionIterator); -ZEND_METHOD(ImagickPixelIterator, setIteratorFirstRow); -ZEND_METHOD(ImagickPixelIterator, setIteratorLastRow); -ZEND_METHOD(ImagickPixelIterator, setIteratorRow); -ZEND_METHOD(ImagickPixelIterator, syncIterator); -ZEND_METHOD(ImagickPixelIterator, valid); - - -static const zend_function_entry class_ImagickPixelIterator_methods = { - ZEND_ME(ImagickPixelIterator, __construct, arginfo_class_ImagickPixelIterator___construct, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, clear, arginfo_class_ImagickPixelIterator_clear, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getPixelIterator, arginfo_class_ImagickPixelIterator_getPixelIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(ImagickPixelIterator, getPixelRegionIterator, arginfo_class_ImagickPixelIterator_getPixelRegionIterator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_MALIAS(ImagickPixelIterator, destroy, clear, arginfo_class_ImagickPixelIterator_destroy, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getIteratorRow, arginfo_class_ImagickPixelIterator_getIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getNextIteratorRow, arginfo_class_ImagickPixelIterator_getNextIteratorRow, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, getPreviousIteratorRow, arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, key, getIteratorRow, arginfo_class_ImagickPixelIterator_key, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, next, getNextIteratorRow, arginfo_class_ImagickPixelIterator_next, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, rewind, resetIterator, arginfo_class_ImagickPixelIterator_rewind, ZEND_ACC_PUBLIC) - ZEND_MALIAS(ImagickPixelIterator, current, getCurrentIteratorRow, arginfo_class_ImagickPixelIterator_current, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, newPixelIterator, arginfo_class_ImagickPixelIterator_newPixelIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, newPixelRegionIterator, arginfo_class_ImagickPixelIterator_newPixelRegionIterator, ZEND_ACC_PUBLIC) - ZEND_ME(ImagickPixelIterator, resetIterator, arginfo_class_ImagickPixelIterator_resetIterator, ZEND_ACC_PUBLIC)
View file
imagick-3.7.0.tgz/imagick-3.7.0/ImagickPixel_arginfo.h
Deleted
@@ -1,346 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 0) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, color) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_destroy arginfo_class_ImagickPixel_clear - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, 0) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalized, IS_LONG, 0, "0") -#else - ZEND_ARG_INFO(0, normalized) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, IS_STRING, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, IS_ARRAY, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 1, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - - -#if MAGICKCORE_HDRI_ENABLE - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) -#endif - -#else - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_LONG, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) -#endif - -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_getHSL arginfo_class_ImagickPixel_getColorQuantum - -#define arginfo_class_ImagickPixel_getIndex arginfo_class_ImagickPixel_getColorCount - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 0, 2) -#endif - - ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three) -#endif -ZEND_END_ARG_INFO() - -#define arginfo_class_ImagickPixel_isSimilar arginfo_class_ImagickPixel_isPixelSimilarQuantum - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, color) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color_count, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color_count) -#endif -ZEND_END_ARG_INFO() - - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, color) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, value) -#endif -ZEND_END_ARG_INFO() -
View file
imagick-3.7.0.tgz/imagick-3.7.0/Imagick_arginfo.h
Deleted
@@ -1,7686 +0,0 @@ -/* This is a generated file, edit the .stub.php file instead. -* Stub hash: regen with 'sh regen_arginfo.sh' -* file has been fixedup for different versions */ - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 1, Imagick, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, metric) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) -#else - ZEND_ARG_INFO(0, image) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) -#else - ZEND_ARG_INFO(0, filehandle) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -#else - ZEND_ARG_INFO(0, filename) -#endif - -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_transposeImage arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_transverseImage arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_trimImage, 0, 1, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_trimImage, 0, 0, 1) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, fuzz) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImage, 0, 2, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImage, 0, 0, 2) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, amplitude) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, length) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 && MagickLibVersion >= 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 3, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 0, 3) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, amplitude) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, length) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, interpolate_method) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 4, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 0, 4) -#endif - - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, black_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) -#else - ZEND_ARG_INFO(0, white_point) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, x) -#endif - -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) -#else - ZEND_ARG_INFO(0, y) -#endif -ZEND_END_ARG_INFO() -#endif - -#if MagickLibVersion > 0x628 -#define arginfo_class_Imagick_uniqueImageColors arginfo_class_Imagick_optimizeImageLayers -#endif - -#if MagickLibVersion > 0x628 && !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 - -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, _IS_BOOL, 0) -#else -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, 0) -#endif - -ZEND_END_ARG_INFO() -#endif
View file
imagick-3.7.0.tgz/imagick-3.7.0/config.m4
Deleted
@@ -1,111 +0,0 @@ -PHP_ARG_WITH(imagick, whether to enable the imagick extension, - --with-imagick=DIR Enables the imagick extension. DIR is the prefix to ImageMagick installation directory., no) - - -if test $PHP_IMAGICK != "no"; then - -# -# Find ImageMagick -# -if test "$ext_shared" != "yes" && test "$ext_shared" != "shared"; then - define('PHP_IMAGICK_STATIC', 1) - PHP_IMAGICK_STATIC=yes -fi -m4_include(ifdef('PHP_IMAGICK_STATIC',PHP_EXT_BUILDDIR(imagick)/,)imagemagick.m4) - -# This line checks that ImageMagick is available, and -# meets our minimum supported version. TODO change to 6.7.0 -IM_FIND_IMAGEMAGICK(6.2.4, $PHP_IMAGICK) - -# -# PHP minimum version -# - AC_MSG_CHECKING(PHP version is at least 5.3.2) - - if test -z "${PHP_VERSION_ID}"; then - if test -z "${PHP_CONFIG}"; then - AC_MSG_ERROR(php-config not found) - fi - if test -z "${AWK}"; then - AC_MSG_ERROR(awk not found) - fi - PHP_IMAGICK_FOUND_VERSION=`${PHP_CONFIG} --version` - PHP_IMAGICK_FOUND_VERNUM=`echo "${PHP_IMAGICK_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 100 + $2) * 100 + $3;}'` - else - PHP_IMAGICK_FOUND_VERNUM="${PHP_VERSION_ID}" - PHP_IMAGICK_FOUND_VERSION="${PHP_VERSION}" - fi - - if test "$PHP_IMAGICK_FOUND_VERNUM" -ge "50302"; then - AC_MSG_RESULT(yes. found $PHP_IMAGICK_FOUND_VERSION) - else - AC_MSG_ERROR(no. found $PHP_IMAGICK_FOUND_VERSION) - fi - -# -# Set libs and CFLAGS for building -# - echo "libs" - echo $IM_IMAGEMAGICK_LIBS - echo "" - echo $IMAGICK_SHARED_LIBADD - - PHP_EVAL_LIBLINE($IM_IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD) - PHP_EVAL_INCLINE($IM_IMAGEMAGICK_CFLAGS) - - old_LIBS=$LIBS - LIBS="$LIBS $IM_IMAGEMAGICK_LIBS" - - PHP_CHECK_FUNC(MagickGetVersion) - - LIBS=$old_LIBS - - AC_MSG_CHECKING(omp_pause_resource_all usability) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM( - #include <omp.h> - , - omp_pause_resource_all(omp_pause_hard); - ), - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(Which flavour of OpenMP to link) - - if test "${GCC}" = "yes"; then - # Open64 (passes for GCC but uses different OpenMP implementation) - if test "x$GOMP_LIBS" = x ; then - if $CC --version 2>&1 | grep Open64 > /dev/null ; then - PHP_CHECK_FUNC(omp_pause_resource_all, openmp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(openmp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(Open64 flavoured OpenMP) - fi - fi - fi - # Clang (passes for GCC but uses different OpenMP implementation) - if test "x$LIB_OMP" = x ; then - if $CC --version 2>&1 | grep clang > /dev/null ; then - PHP_CHECK_FUNC(omp_pause_resource_all, omp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(omp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(Clang flavoured OpenMP) - fi - fi - fi - # GCC - if test "x$ac_cv_func_omp_pause_resource_all" = x ; then - PHP_CHECK_FUNC(omp_pause_resource_all, gomp) - if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then - PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD) - AC_MSG_RESULT(GCC flavoured OpenMP) - fi - fi - fi - - , - AC_MSG_RESULT(no) - ) - - 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) - PHP_INSTALL_HEADERS(ext/imagick, php_imagick_shared.h) -fi
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick.c
Deleted
@@ -1,1295 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_shared.h" - -#if PHP_VERSION_ID >= 70000 -#include "ext/standard/php_smart_string.h" -#else -#include "ext/standard/php_smart_str.h" -#endif - -#if PHP_VERSION_ID < 70200 -///* For the countable interface */ -#include "ext/spl/spl_iterators.h" -#endif - -#include "shim_php7_to_php8.h" - -#if HAVE_OMP_PAUSE_RESOURCE_ALL -#include <omp.h> -#endif - -ZEND_DECLARE_MODULE_GLOBALS(imagick) - -#ifdef IMAGICK_WITH_KERNEL - #if PHP_VERSION_ID >= 80000 - HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC); /* {{{ */ - #else - HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC); /* {{{ */ - #endif -#endif - -#if MAGICKCORE_HDRI_ENABLE - #define IMAGICK_QUANTUM_TYPE IS_DOUBLE -#else - #define IMAGICK_QUANTUM_TYPE IS_LONG -#endif - -zend_class_entry *php_imagick_sc_entry; -zend_class_entry *php_imagick_exception_class_entry; -zend_class_entry *php_imagickdraw_sc_entry; -zend_class_entry *php_imagickdraw_exception_class_entry; -zend_class_entry *php_imagickpixel_sc_entry; -zend_class_entry *php_imagickpixel_exception_class_entry; -zend_class_entry *php_imagickpixeliterator_sc_entry; -zend_class_entry *php_imagickpixeliterator_exception_class_entry; -#ifdef IMAGICK_WITH_KERNEL -zend_class_entry *php_imagickkernel_sc_entry; -zend_class_entry *php_imagickkernel_exception_class_entry; -#endif - -#if defined(ZTS) && defined(PHP_WIN32) -static MUTEX_T imagick_mutex; -static THREAD_T imagick_thread_id; -#endif - -/* Handlers */ -static zend_object_handlers imagick_object_handlers; -static zend_object_handlers imagickdraw_object_handlers; -static zend_object_handlers imagickpixel_object_handlers; -static zend_object_handlers imagickpixeliterator_object_handlers; -#ifdef IMAGICK_WITH_KERNEL -static zend_object_handlers imagickkernel_object_handlers; -#endif - -/* External API */ -PHP_IMAGICK_API zend_class_entry *php_imagick_get_class_entry() -{ - return php_imagick_sc_entry; -} - -PHP_IMAGICK_API zend_class_entry *php_imagickdraw_get_class_entry() -{ - return php_imagickdraw_sc_entry; -} - -PHP_IMAGICK_API zend_class_entry *php_imagickpixel_get_class_entry() -{ - return php_imagickpixel_sc_entry; -} - -static zend_function_entry php_imagick_functions = -{ - { NULL, NULL, NULL, 0, 0 } -}; - - -#include "ImagickDraw_arginfo.h" -const zend_function_entry *php_imagickdraw_class_methods = class_ImagickDraw_methods; - -#include "ImagickPixelIterator_arginfo.h" -const zend_function_entry *php_imagickpixeliterator_class_methods = class_ImagickPixelIterator_methods; - -#include "ImagickPixel_arginfo.h" -const zend_function_entry *php_imagickpixel_class_methods = class_ImagickPixel_methods; - -#include "Imagick_arginfo.h" -const zend_function_entry *php_imagick_class_methods = class_Imagick_methods; - -#ifdef IMAGICK_WITH_KERNEL -#include "ImagickKernel_arginfo.h" -const zend_function_entry *php_imagickkernel_class_methods = class_ImagickKernel_methods; -#endif - -static void php_imagick_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagick_object *intern = php_imagick_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->progress_monitor_name) { - //TODO - is this meant to be free by us? - efree(intern->progress_monitor_name); - } - - if (intern->magick_wand != NULL) { - intern->magick_wand = DestroyMagickWand(intern->magick_wand); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); -#if PHP_VERSION_ID < 70000 - efree(intern); -#endif -} - - -static void php_imagickdraw_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickdraw_object *intern = php_imagickdraw_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->drawing_wand != NULL) { - intern->drawing_wand = DestroyDrawingWand(intern->drawing_wand); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); - - #if PHP_VERSION_ID < 70000 - efree(intern); - #endif -} - -static void php_imagickpixeliterator_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickpixeliterator_object *intern = php_imagickpixeliterator_fetch_object(object); - - if (!intern) { - return; - } - - if (intern->pixel_iterator != NULL) { - intern->pixel_iterator = DestroyPixelIterator(intern->pixel_iterator); - } - - zend_object_std_dtor(&intern->zo TSRMLS_CC); - #if PHP_VERSION_ID < 70000 - efree(intern); - #endif -} - - - -static void php_imagickpixel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) -{ - php_imagickpixel_object *intern = php_imagickpixel_fetch_object(object); - - if (!intern) { - return; - } - if (!intern->initialized_via_iterator && intern->pixel_wand) - intern->pixel_wand = DestroyPixelWand(intern->pixel_wand); - - zend_object_std_dtor(&intern->zo TSRMLS_CC);
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_class.c
Deleted
@@ -1,14638 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_file.h" - - -#if MagickLibVersion > 0x628 -/* {{{ proto bool Imagick::pingImageFile(resource filehandle) - Query image information without reading the whole image to memory -*/ -PHP_METHOD(Imagick, pingImageFile) -{ - char *filename = NULL; - IM_LEN_TYPE filename_len; - php_imagick_object *intern; - zval *zstream; - php_stream *stream; - zend_bool result; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) - { - return; - } - - intern = Z_IMAGICK_P(getThis()); - -#if PHP_VERSION_ID >= 70000 - php_stream_from_zval(stream, zstream); -#else - php_stream_from_zval(stream, &zstream); -#endif - result = php_imagick_stream_handler(intern, stream, ImagickPingImageFile TSRMLS_CC); - - if (result == 0) { - if (!EG(exception)) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image from the filehandle" TSRMLS_CC); - } - return; - } - - if (filename) { - MagickSetImageFilename(intern->magick_wand, filename); - MagickSetLastIterator(intern->magick_wand); - } - RETURN_TRUE; -} -/* }}} */ - - -/* {{{ proto bool Imagick::pingImageBlob(string image ) - Query image information without reading the whole image to memory -*/ -PHP_METHOD(Imagick, pingImageBlob) -{ - char *image_string; - IM_LEN_TYPE image_string_len; - MagickBooleanType status; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &image_string, &image_string_len) == FAILURE) { - return; - } - - if (image_string_len == 0) { - php_imagick_throw_exception(IMAGICK_CLASS, "Empty image string passed" TSRMLS_CC); - return; - } - - intern = Z_IMAGICK_P(getThis()); - status = MagickPingImageBlob(intern->magick_wand, image_string, image_string_len); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image blob" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::vignetteImage(float blackPoint, float whitePoint, int x, int y ) - Adds vignette filter to the image -*/ -PHP_METHOD(Imagick, vignetteImage) -{ - double black_point, white_point; - im_long x, y; - php_imagick_object *intern; - MagickBooleanType status; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &black_point, &white_point, &x, &y) == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickVignetteImage(intern->magick_wand, black_point, white_point, x, y); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to apply vignette filter" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::transposeImage() - Creates a vertical mirror image -*/ -PHP_METHOD(Imagick, transposeImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTransposeImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transpose image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::transverseImage() - Creates a horizontal mirror image -*/ -PHP_METHOD(Imagick, transverseImage) -{ - php_imagick_object *intern; - MagickBooleanType status; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - intern = Z_IMAGICK_P(getThis()); - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - status = MagickTransverseImage(intern->magick_wand); - - /* No magick is going to happen */ - if (status == MagickFalse) { - php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transverse image" TSRMLS_CC); - return; - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool Imagick::adaptiveBlurImage(float radius, float sigma, int channel ) - Adds adaptive blur filter to image -*/ -PHP_METHOD(Imagick, adaptiveBlurImage) -{ - double radius, sigma; - php_imagick_object *intern; - MagickBooleanType status; - im_long channel = IM_DEFAULT_CHANNEL;
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_file.c
Deleted
@@ -1,369 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_file.h" -#include "php_imagick_macros.h" -#include "php_imagick_defs.h" - -#if ZEND_MODULE_API_NO > 20060613 -# define IMAGICK_INIT_ERROR_HANDLING zend_error_handling error_handling -# define IMAGICK_SET_ERROR_HANDLING_THROW zend_replace_error_handling(EH_THROW, php_imagick_exception_class_entry, &error_handling TSRMLS_CC) -# define IMAGICK_RESTORE_ERROR_HANDLING zend_restore_error_handling(&error_handling TSRMLS_CC) -#else -# define IMAGICK_INIT_ERROR_HANDLING -# define IMAGICK_SET_ERROR_HANDLING_THROW php_set_error_handling(EH_THROW, php_imagick_exception_class_entry TSRMLS_CC) -# define IMAGICK_RESTORE_ERROR_HANDLING php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) -#endif - -#ifndef S_ISDIR -# define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -static -zend_bool php_imagick_is_virtual_format(const char *format) -{ - int i, elements; - - const char *virtual_fmt = { - "CANVAS", - "CAPTION", - "CLIPBOARD", - "FRACTAL", - "GRADIENT", - "GRANITE", - "HALD", // Identity Hald CLUT Image Select levels like this: hald:8 for level 8. - "INLINE", // Base64-encoded inline image - "LABEL", - "LOGO", - "MAGICK", - "MAP", // Colormap intensities and indices Set -depth to set the sample size of the intensities; indices are 16-bit if colors > 256. - "MASK", // Image mask - "MATTE", - "NETSCAPE", - "NULL", - "PANGO", // Image caption - "PLASMA", - "PRINT", - "RADIAL-GRADIENT", - "RADIAL_GRADIENT", - "ROSE" - "SCAN", - "SCANX", - "TILE", // Tiled image - "UNIQUE", - "WIN", -#ifndef PHP_WIN32 - "X", -#endif - "XC", - }; - - elements = sizeof (virtual_fmt) / sizeof (virtual_fmt 0); - - for (i = 0; i < elements; i++) { - if (strcasecmp(format, virtual_fmti) == 0) { - return 1; - } - } - return 0; -} - -static -zend_bool php_imagick_is_url(const char *filename TSRMLS_DC) -{ - const char *path_for_open; - - if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) { - return 1; - } - return 0; -} - -zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC) -{ - char magick_pathMaxTextExtent, head_pathMaxTextExtent, tail_pathMaxTextExtent, bufferMaxTextExtent; - - if (!filename_len) { - return 0; - } - - /* Undefined for now */ - file->type = ImagickUndefinedType; - - if (filename_len >= MaxTextExtent) { - return 0; - } - - /* Take a copy of the original string */ - strlcpy(file->filename, filename, MaxTextExtent); - file->filename_len = filename_len; - - /* Break the path into pieces */ - memset(magick_path, 0, MaxTextExtent); - GetPathComponent(file->filename, MagickPath, magick_path); - - /* The path has a format identifier, check for url and virtual format */ - if (strlen(magick_path) > 0) { - /* Virtual format? */ - if (php_imagick_is_virtual_format(magick_path)) { - file->type = ImagickVirtualFormat; - file->absolute_path = estrdup(""); - return 1; - } - /* Is it an url? */ - else if (php_imagick_is_url(filename TSRMLS_CC)) { - file->type = ImagickUri; - file->absolute_path = estrdup(""); - return 1; - } - } - - /* This is a normal file path */ - file->type = ImagickFile; - - memset(head_path, 0, MaxTextExtent); - memset(tail_path, 0, MaxTextExtent); - - GetPathComponent(file->filename, HeadPath, head_path); - GetPathComponent(file->filename, TailPath, tail_path); - - (void) snprintf(buffer, MaxTextExtent, "%s/%s", head_path, tail_path); - - /* The full path to the file */ - file->absolute_path = expand_filepath(buffer, NULL TSRMLS_CC); - - /* Failed to resolve absolute path */ - if (!file->absolute_path) { - file->absolute_path = estrdup(""); - } - return 1; -} - -void php_imagick_file_deinit(struct php_imagick_file_t *file) -{ - if (file->absolute_path) { - efree(file->absolute_path); - file->absolute_path = NULL; - } -} - -static -int php_imagick_read_image_using_imagemagick(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) -{ - -#if PHP_VERSION_ID < 70000 -#if PHP_VERSION_ID >= 50600 -#ifdef ZTS - // This suppresses an 'unused parameter' warning. - (void)tsrm_ls; -#endif -#endif -#endif - - if (type == ImagickReadImage) { - if (MagickReadImage(intern->magick_wand, file->filename) == MagickFalse) { - -#if PHP_VERSION_ID >= 70000 - zend_stat_t st; -#else - struct stat st; -#endif - - /* Resolved to a filename. Check that it's not a dir */ - if (php_sys_stat(file->absolute_path, &st) == 0 && S_ISDIR(st.st_mode)) { - return IMAGICK_RW_PATH_IS_DIR; - } - return IMAGICK_RW_UNDERLYING_LIBRARY; - } - } else if (type == ImagickPingImage){ - if (MagickPingImage(intern->magick_wand, file->filename) == MagickFalse) { - return IMAGICK_RW_UNDERLYING_LIBRARY; - }
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagick_helpers.c
Deleted
@@ -1,2017 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -MagickBooleanType php_imagick_progress_monitor(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *client_data) -{ - FILE *fp; - php_imagick_object *intern = (php_imagick_object *)client_data; - - if (!intern) { - return MagickFalse; - } - - if (!intern->progress_monitor_name) { - return MagickFalse; - } - - fp = fopen(intern->progress_monitor_name, "a+"); - - if (!fp) { - return MagickFalse; - } - - fprintf(fp, "text: %s, offset: %lld, span: %lld\n", text, offset, span); - fclose(fp); - return MagickTrue; -} - -void php_imagick_cleanup_progress_callback(php_imagick_callback* progress_callback TSRMLS_DC) { - - if (progress_callback) { - if (progress_callback->previous_callback) { - php_imagick_cleanup_progress_callback(progress_callback->previous_callback TSRMLS_CC); - efree(progress_callback->previous_callback); - } - -#if PHP_VERSION_ID >= 70000 - zval_ptr_dtor(&progress_callback->user_callback); -#else - zval_ptr_dtor(&progress_callback->user_callback); -#endif - } -} - -MagickBooleanType php_imagick_progress_monitor_callable(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *userData) -{ - int error; - zend_fcall_info fci; - zend_fcall_info_cache fci_cache; - -#if PHP_VERSION_ID >= 70000 - zval zargs2; - zval retval; -#else - zval **zargs2; - zval *retval_ptr; -#endif - - //We can get the data both via the passed param and via - //IMAGICK_G(progress_callback) - this should be quicker - php_imagick_callback *callback = (php_imagick_callback*)userData; - - // This suppresses an 'unused parameter' warning. - // We could maybe use text. - (void)text; - -#if PHP_VERSION_ID >= 70000 && defined(ZTS) - if( NULL == tsrm_get_ls_cache() ) { - return MagickTrue; - } -#endif - -#if PHP_VERSION_ID < 70000 - TSRMLS_FETCH_FROM_CTX(callback->thread_ctx); -#endif - fci_cache = empty_fcall_info_cache; - - fci = empty_fcall_info; - fci.size = sizeof(fci); - -#if PHP_VERSION_ID < 70100 - fci.function_table = EG(function_table); -#endif -#if PHP_VERSION_ID >= 70000 - //fci.function_name = *callback->user_callback; - ZVAL_COPY_VALUE(&fci.function_name, &callback->user_callback); - fci.retval = &retval; -#else - retval_ptr = NULL; - fci.function_name = callback->user_callback; - fci.retval_ptr_ptr = &retval_ptr; -#endif - fci.param_count = 2; - fci.params = zargs; - -#if PHP_VERSION_ID >= 70000 - ZVAL_LONG(&zargs0, offset); - ZVAL_LONG(&zargs1, span); -#else - zargs0 = emalloc(sizeof(zval *)); - MAKE_STD_ZVAL(*zargs0); - ZVAL_LONG(*zargs0, offset); - - zargs1 = emalloc(sizeof(zval *)); - MAKE_STD_ZVAL(*zargs1); - ZVAL_LONG(*zargs1, span); -#endif - - error = zend_call_function(&fci, &fci_cache TSRMLS_CC); - - if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback"); - //Abort processing as user callback is no longer callable - return MagickFalse; - } -#if PHP_VERSION_ID >= 70000 - if (Z_TYPE(retval) == IS_FALSE) { - //User returned false - tell Imagick to abort processing. - return MagickFalse; - } -#else - zval_ptr_dtor(zargs0); - zval_ptr_dtor(zargs1); - - if (retval_ptr) { - if (Z_TYPE_P(retval_ptr) == IS_BOOL) { - if (Z_LVAL_P(retval_ptr) == 0) { - //User returned false - tell Imagick to abort processing. - return MagickFalse; - } - } - } -#endif - - return MagickTrue; -} - -/* This is not universally safe to use, but is safe enough for values that will - be encountered for image dimensions. -*/ -static inline double im_round_helper(double value) { - if (value >= 0.0) { - // Prevent zero width/height images - if (value < 1) { - return 1; - } - return floor(value + 0.5); - } else { - return ceil(value - 0.5); - } -} - - -zend_bool php_imagick_thumbnail_dimensions(MagickWand *magick_wand, zend_bool bestfit, im_long desired_width, im_long desired_height, im_long *new_width, im_long *new_height, zend_bool legacy) -{ - im_long orig_width, orig_height; - - orig_width = MagickGetImageWidth(magick_wand); - orig_height = MagickGetImageHeight(magick_wand); - - if ((orig_width == desired_width) && (orig_height == desired_height)) { - *new_width = desired_width; - *new_height = desired_height; - return 1; - } - - if (bestfit) { - double ratio_x, ratio_y; - - if (desired_width <= 0 || desired_height <= 0) { - return 0; - } - - ratio_x = (double) desired_width / (double) orig_width; - ratio_y = (double) desired_height / (double) orig_height; - - //in the case of square images there should be no rounding error - if (ratio_x == ratio_y) {
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickdraw_class.c
Deleted
@@ -1,3087 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion > 0x628 -/* {{{ proto bool ImagickDraw::resetvectorgraphics() - Resets the vector graphics -*/ -PHP_METHOD(ImagickDraw, resetVectorGraphics) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis()); - DrawResetVectorGraphics(internd->drawing_wand); - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x649 -/* {{{ proto bool ImagickDraw::getTextKerning() - Gets the text kerning -*/ -PHP_METHOD(ImagickDraw, getTextKerning) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextKerning(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextKerning(float kerning) - Sets the text kerning -*/ -PHP_METHOD(ImagickDraw, setTextKerning) -{ - php_imagickdraw_object *internd; - double kerning; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &kerning) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextKerning(internd->drawing_wand, kerning); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::getTextInterwordSpacing() - Gets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, getTextInterwordSpacing) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextInterwordSpacing(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextInterwordSpacing(float spacing) - Sets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, setTextInterwordSpacing) -{ - php_imagickdraw_object *internd; - double spacing; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextInterwordSpacing(internd->drawing_wand, spacing); - RETURN_TRUE; -} -/* }}} */ -#endif - -#if MagickLibVersion > 0x655 -/* {{{ proto bool ImagickDraw::getTextInterlineSpacing() - Gets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, getTextInterlineSpacing) -{ - php_imagickdraw_object *internd; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - RETURN_DOUBLE(DrawGetTextInterlineSpacing(internd->drawing_wand)); -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::setTextInterlineSpacing(float spacing) - Sets the text interword spacing -*/ -PHP_METHOD(ImagickDraw, setTextInterlineSpacing) -{ - php_imagickdraw_object *internd; - double spacing; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - DrawSetTextInterlineSpacing(internd->drawing_wand, spacing); - RETURN_TRUE; -} -/* }}} */ -#endif - -/* {{{ proto ImagickDraw ImagickDraw::__construct() - The ImagickDraw constructor -*/ -PHP_METHOD(ImagickDraw, __construct) -{ - /* Empty constructor for possible future uses */ - -#if PHP_VERSION_ID >= 70000 - // This suppresses an 'unused parameter' warning. - (void)execute_data; - (void)return_value; -#endif -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::circle(float ox, float oy, float px, float py) - Draws a circle on the image. -*/ -PHP_METHOD(ImagickDraw, circle) -{ - double ox, oy, px, py; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &ox, &oy, &px, &py) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());; - - DrawCircle(internd->drawing_wand, ox, oy, px, py); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickDraw::rectangle(float x1, float y1, float x2, float y2) - Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings. -*/ -PHP_METHOD(ImagickDraw, rectangle) -{ - double x1, y1, x2, y2; - php_imagickdraw_object *internd; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x2, &y2) == FAILURE) { - return; - } - - internd = Z_IMAGICKDRAW_P(getThis());;
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickkernel_class.c
Deleted
@@ -1,864 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Dan Ackroyd <danack@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#ifdef IMAGICK_WITH_KERNEL - -#if MagickLibVersion < 0x691 -// These function defines are required currently as the functions are -// currently not available in the public ImageMagick header files -// This is being fixed for the next version of ImageMagick. -Image - *MorphologyApply(const Image *,const ChannelType,const MorphologyMethod, - const ssize_t,const KernelInfo *,const CompositeOperator,const double, - ExceptionInfo *); - -void - ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), - UnityAddKernelInfo(KernelInfo *,const double), - ZeroKernelNans(KernelInfo *); -#endif - - -static void php_imagickkernelvalues_to_zval(zval *zv, KernelInfo *kernel_info) { - int count; - double value; - unsigned int x, y; -#if PHP_VERSION_ID >= 70000 - zval row; -#else - zval *row; -#endif - - zval *p_row; - - count = 0; - - for (y=0; y<kernel_info->height ; y++) { -#if PHP_VERSION_ID >= 70000 - p_row = &row; -#else - MAKE_STD_ZVAL(row); - p_row = row; -#endif - - array_init(p_row); - for (x=0; x<kernel_info->width ; x++) { - value = kernel_info->valuescount; - count++; - - //nan is not equal to itself - if (value != value) { - //this will be broken by some compilers - need to investigate more... - add_next_index_bool(p_row, 0); - } - else { - add_next_index_double(p_row, value); - } - } - - add_next_index_zval(zv, p_row); - } -} - - -#if PHP_VERSION_ID >= 80000 -HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC) /* {{{ */ -#else -HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ -#endif -{ - php_imagickkernel_object *internp; - HashTable *debug_info; - KernelInfo *kernel_info; -#if PHP_VERSION_ID >= 70000 - zval matrix; -#else - zval *matrix; -#endif - - *is_temp = 1; //var_dump will destroy the hashtable - -#if PHP_VERSION_ID >= 80000 - internp = php_imagickkernel_fetch_object(obj); -#else - internp = Z_IMAGICKKERNEL_P(obj); -#endif - kernel_info = internp->kernel_info; - - ALLOC_HASHTABLE(debug_info); - ZEND_INIT_SYMTABLE_EX(debug_info, 1, 0); - - while (kernel_info != NULL) { -#if PHP_VERSION_ID >= 70000 - array_init(&matrix); - php_imagickkernelvalues_to_zval(&matrix, kernel_info); - zend_hash_next_index_insert(debug_info, &matrix); -#else - MAKE_STD_ZVAL(matrix); - array_init(matrix); - php_imagickkernelvalues_to_zval(matrix, kernel_info); - zend_hash_next_index_insert(debug_info, &matrix, sizeof(zval *), NULL); -#endif - kernel_info = kernel_info->next; - } - - return debug_info; -} - - -static void im_CalcKernelMetaData(KernelInfo *kernel) { - size_t i; - - kernel->minimum = kernel->maximum = 0.0; - kernel->negative_range = kernel->positive_range = 0.0; - - for (i=0; i < (kernel->width*kernel->height); i++) { - if (fabs(kernel->valuesi) < MagickEpsilon) { - kernel->valuesi = 0.0; - } - if (kernel->valuesi < 0) { - kernel->negative_range += kernel->valuesi; - } - else { - kernel->positive_range += kernel->valuesi; - } - if (kernel->valuesi < kernel->minimum) { - kernel->minimum = kernel->valuesi; - } - - if (kernel->valuesi > kernel->maximum) { - kernel->maximum = kernel->valuesi; - } - } - - return; -} - - -#if MagickLibVersion > 0x661 -static KernelInfo *imagick_createKernel(KernelValueType *values, size_t width, size_t height, size_t origin_x, size_t origin_y) -{ - KernelInfo *kernel_info; - -#if MagickLibVersion >= 0x700 - unsigned int i; - ExceptionInfo *_exception_info = (ExceptionInfo *) NULL; - //TODO - inspect exception info - kernel_info=AcquireKernelInfo(NULL, _exception_info); -#else - kernel_info=AcquireKernelInfo(NULL); -#endif - if (kernel_info == (KernelInfo *) NULL) { - return NULL; - } - - kernel_info->width = width; - kernel_info->height = height; - - kernel_info->x = origin_x; - kernel_info->y = origin_y; - - //Need to free old values? - if (kernel_info->values != NULL) { - RelinquishAlignedMemory(kernel_info->values); - } - -#if MagickLibVersion >= 0x700 - kernel_info->values = (MagickRealType *)AcquireAlignedMemory(width*height, sizeof(MagickRealType)); - - for (i=0; i<width*height;i++) { - kernel_info->valuesi = (MagickRealType)valuesi; - } - -#else - kernel_info->values = values; -#endif - - im_CalcKernelMetaData(kernel_info); - - return kernel_info; -} -#endif
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickpixel_class.c
Deleted
@@ -1,841 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion > 0x628 -/* {{{ proto array ImagickPixel::getHSL() - Returns the normalized HSL color of the pixel wand in an array with the keys "hue", "saturation", and "luminosity". -*/ -PHP_METHOD(ImagickPixel, getHSL) -{ - php_imagickpixel_object *internp; - double hue, saturation, luminosity; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelGetHSL(internp->pixel_wand, &hue, &saturation, &luminosity); - - array_init(return_value); - add_assoc_double(return_value, "hue", hue); - add_assoc_double(return_value, "saturation", saturation); - add_assoc_double(return_value, "luminosity", luminosity); - return; -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setHSL(float hue, float saturation, float luminosity) - Sets the normalized HSL color of the pixel wand. -*/ -PHP_METHOD(ImagickPixel, setHSL) -{ - php_imagickpixel_object *internp; - double hue, saturation, luminosity; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &hue, &saturation, &luminosity) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - PixelSetHSL(internp->pixel_wand, hue, saturation, luminosity); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto Quantum ImagickPixel::getColorValueQuantum(int color) - Gets the quantum value of a color in the ImagickPixel. Quantum is a float if ImageMagick was compiled with HDRI - otherwise an integer. -*/ -PHP_METHOD(ImagickPixel, getColorValueQuantum) -{ - php_imagickpixel_object *internp; - im_long color; - Quantum color_value; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { - return; - } - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - switch (color) { - - case PHP_IMAGICK_COLOR_BLACK: - color_value = PixelGetBlackQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_BLUE: - color_value = PixelGetBlueQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_CYAN: - color_value = PixelGetCyanQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_GREEN: - color_value = PixelGetGreenQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_RED: - color_value = PixelGetRedQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_YELLOW: - color_value = PixelGetYellowQuantum(internp->pixel_wand); - break; - - case PHP_IMAGICK_COLOR_MAGENTA: - color_value = PixelGetMagentaQuantum(internp->pixel_wand); - break; - -#if MagickLibVersion < 0x700 - case PHP_IMAGICK_COLOR_OPACITY: - color_value = PixelGetOpacityQuantum(internp->pixel_wand); - break; -#endif - - case PHP_IMAGICK_COLOR_ALPHA: - color_value = PixelGetAlphaQuantum(internp->pixel_wand); - break; - - default: - php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); - return; - break; - } - -#if MAGICKCORE_HDRI_ENABLE - RETVAL_DOUBLE(color_value); -#else - RETVAL_LONG(color_value); -#endif -} -/* }}} */ - -/* {{{ proto bool ImagickPixel::setColorValueQuantum(int color, float value) - Sets the quantum color of the ImagickPixel. -*/ -PHP_METHOD(ImagickPixel, setColorValueQuantum) -{ - php_imagickpixel_object *internp; - im_long color; - -#if MAGICKCORE_HDRI_ENABLE - double color_value; - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { - return; - } -#else - im_long color_value; - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &color, &color_value) == FAILURE) { - return; - } -#endif - - internp = Z_IMAGICKPIXEL_P(getThis()); - if (php_imagickpixel_ensure_not_null(internp->pixel_wand) == 0) { - return; - } - - switch (color) { - - case PHP_IMAGICK_COLOR_BLACK: - PixelSetBlackQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_BLUE: - PixelSetBlueQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_CYAN: - PixelSetCyanQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_GREEN: - PixelSetGreenQuantum(internp->pixel_wand, color_value); - break; - - case PHP_IMAGICK_COLOR_RED: - PixelSetRedQuantum(internp->pixel_wand, color_value); - break; -
View file
imagick-3.7.0.tgz/imagick-3.7.0/imagickpixeliterator_class.c
Deleted
@@ -1,635 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" - -#if MagickLibVersion <= 0x628 -static -long s_count_pixeliterator_rows(php_imagickpixeliterator_object *internpix) -{ - long rows = 0, tmp; - PixelWand **row; - PixelResetIterator(internpix->pixel_iterator); - - while ((row = PixelGetNextIteratorRow(internpix->pixel_iterator, &tmp)) != NULL) - rows++; - - return rows; -} -#endif - -void php_imagick_pixel_iterator_new (PixelIterator *pixel_it, zval *return_value TSRMLS_DC) -{ - php_imagickpixeliterator_object *internpix; - - object_init_ex(return_value, php_imagickpixeliterator_sc_entry); - internpix = Z_IMAGICKPIXELITERATOR_P(return_value); - - internpix->pixel_iterator = pixel_it; - internpix->initialized = 1; - -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif -} - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::__construct(Imagick source) - The ImagickPixelIterator constructor -*/ -PHP_METHOD(ImagickPixelIterator, __construct) -{ - zval *magick_object; - php_imagickpixeliterator_object *internpix; - php_imagick_object *intern; - - /* Parse parameters given to function */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|llll", &magick_object, php_imagick_sc_entry) == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - intern = Z_IMAGICK_P(magick_object); - - if (!intern->magick_wand) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); - return; - } - - if (php_imagick_ensure_not_empty (intern->magick_wand) == 0) - return; - - internpix->pixel_iterator = NewPixelIterator(intern->magick_wand); - - if (!internpix->pixel_iterator) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); - return; - } - -#if MagickLibVersion <= 0x628 - internpix->rows = s_count_pixeliterator_rows (internpix); -#endif - - internpix->initialized = 1; - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::resetIterator() - Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. -*/ -PHP_METHOD(ImagickPixelIterator, resetIterator) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelResetIterator(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = 0; -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::syncIterator() - Syncs the pixel iterator. -*/ -PHP_METHOD(ImagickPixelIterator, syncIterator) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSyncIterator(internpix->pixel_iterator); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::setIteratorFirstRow() - Sets the pixel iterator to the first pixel row. -*/ -PHP_METHOD(ImagickPixelIterator, setIteratorFirstRow) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSetFirstIteratorRow(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = 0; -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto bool ImagickPixelIterator::setIteratorLastRow() - Sets the pixel iterator to the last pixel row. -*/ -PHP_METHOD(ImagickPixelIterator, setIteratorLastRow) -{ - php_imagickpixeliterator_object *internpix; - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); - - if (!internpix->initialized) { - php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); - return; - } - - PixelSetLastIteratorRow(internpix->pixel_iterator); -#if MagickLibVersion <= 0x628 - internpix->iterator_position = (internpix->rows - 1); -#endif - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto ImagickPixelIterator ImagickPixelIterator::getPixelIterator(Imagick source) - Returns a new pixel iterator, static method. This is equivalent to Imagick::getPixelIterator
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagemagick_version_defs.h
Deleted
@@ -1,225 +0,0 @@ - -#ifndef PHP_IMAGEMAGICK_VERSION_DEFS_H -# define PHP_IMAGEMAGICK_VERSION_DEFS_H - -// Q) Why are the defines done in this file? -// -// A) Checking whether an ImageMagick function is available _and_ usable is -// annoyingly difficult. It's pretty common for new functions to be introduced -// in patch releases, (e.g. 6.5.4-8) rather than in minor releases (6.5.5-0). -// -// Additionally, the api for new functions often changes quite rapidly in the -// first few versions it is available in, which means we can't just check for -// the presence of the symbol -// -// Because of those two things, the sanest thing to do is to support features -// based on the minimum minor version from which they are continually -// available and stable. -// -// Any mistake in which version is required for a feature can be fixed in a -// single place, rather than having to have duplicated info elsewhere. - - -#if MagickLibVersion >= 0x700 - #if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 - #endif -#elif MagickLibVersion >= 0x631 - #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 -#endif - - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR 1 -#endif - - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_SETSEED 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_MEANSHIFTIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_KMEANSIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_BILATERALBLURIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_CLAHEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_CHANNELFXIMAGE 1 -#endif - -#if MagickLibVersion >= 0x710 - #define IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_COMPLEXIMAGES 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_LEVELIMAGECOLORS 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_LEVELIZEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE 1 -#endif - -#if MagickLibVersion >= 0x70B - #define IM_HAVE_IMAGICK_WHITEBALANCEIMAGE 1 -#endif - -#if MagickLibVersion >= 0x702 - #define IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_DELETE_OPTION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_MEAN 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_IMAGE_RANGE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_OPTIONS 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_ORIENTATION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_RESOLUTION 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_GET_TYPE 1 -#endif - -#if MagickLibVersion >= 0x709 - #define IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_DEPTH 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_EXTRACT 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD 1 -#endif - -#if MagickLibVersion >= 0x701 - #define IM_HAVE_IMAGICK_SET_ORIENTATION 1 -#endif - -#if MagickLibVersion >= 0x70A - // Technically, this may be available earlier, but the behaviour around - // default mask changed. - #define IM_HAVE_IMAGICK_GETSETIMAGEMASK 1 - -// ImageMagick forget to export the header until about 7.0.11-14... -WandExport MagickBooleanType MagickSetImageMask( - MagickWand *wand, const PixelMask type, const MagickWand *clip_mask -); - -#endif - -// The above is sub-optimal as it's hard to read. It'd be better to do -// something like the below: - -//#define MAGICK_LIB_RANGE(NAME, IM6_VERSION, IM7_VERSION) slash -//#if MagickLibVersion >= 0x700 slash -// #if MagickLibVersion >= IM7_VERSION slash -// #define IM_HAVE_##NAME 1 slash -// #endif slash -//#elif MagickLibVersion >= 0x600 slash -// #if MagickLibVersion >= IM6_VERSION slash -// #define IM_HAVE_##NAME 1 slash -// #endif slash -//#endif - -// MAGICK_LIB_RANGE(IMAGICK_SETIMAGEINTERPOLATEMETHOD, 0x631, 0x702)
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick.h
Deleted
@@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ -#ifndef PHP_IMAGICK_H -/* Prevent double inclusion */ -#define PHP_IMAGICK_H - -/* Define Extension Properties */ -#define PHP_IMAGICK_EXTNAME "imagick" -// The version is deliberately left as 'PACKAGE_VERSION' in source code. -// It is only replaced with the actual version number that packaged through pecl.php.net -#define PHP_IMAGICK_VERSION "3.7.0" -#define PHP_IMAGICK_EXTNUM 30700 - -/* Import configure options when building - outside of the PHP source tree */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifdef ZTS -# include "TSRM.h" -#endif - -/* Include PHP Standard Headers */ -#include "php.h" - -/* Define the entry point symbol - * ZE will use when loading this module - */ -extern zend_module_entry imagick_module_entry; -#define phpext_imagick_ptr &imagick_module_entry - -#endif /* PHP_IMAGICK_H */ -
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick_defs.h
Deleted
@@ -1,1254 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ -#ifndef PHP_IMAGICK_DEFS_H /* PHP_IMAGICK_DEFS_H */ -# define PHP_IMAGICK_DEFS_H - -/* Include magic wand header */ -#if defined (IM_MAGICKWAND_HEADER_STYLE_SEVEN) -# include <MagickWand/MagickWand.h> -#elif defined (IM_MAGICKWAND_HEADER_STYLE_OLD) -# include <wand/magick-wand.h> -#else -# include <wand/MagickWand.h> -#endif - -#include "php_imagemagick_version_defs.h" - -#if MagickLibVersion >= 0x700 -#include "shim_im6_to_im7.h" -#endif - -/* Some extra headers */ -#include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" -#include "ext/standard/php_string.h" -#include "ext/standard/info.h" -#include "ext/standard/php_filestat.h" -#include "php_ini.h" -#include "Zend/zend.h" - -#if PHP_VERSION_ID >= 80000 - #define HAVE_LOCALE_H - #define TSRMLS_C - #define TSRMLS_CC - #define TSRMLS_D - #define TSRMLS_DC - #define TSRMLS_FETCH() - #define TSRMLS_SET_CTX(ctx) -#endif - -/* Include locale header */ -#ifdef HAVE_LOCALE_H -# include <locale.h> -#endif - -#if MagickLibVersion >= 0x680 - #define IMAGICK_WITH_KERNEL -#endif - - - -#if MagickLibVersion >= 0x700 -#if !defined(MaxTextExtent) -# define MaxTextExtent 4096 /* always >= 4096 */ -#endif - -#endif - - -#if PHP_VERSION_ID >= 70000 - #define im_long zend_long -#else - #define im_long long -#endif - -#if PHP_VERSION_ID >= 70200 - #define im_ce_countable zend_ce_countable -#else - #define im_ce_countable spl_ce_Countable -#endif - -typedef struct _php_imagick_callback { - void ***thread_ctx; -#if PHP_VERSION_ID >= 70000 - zval user_callback; -#else - zval *user_callback; -#endif - struct _php_imagick_callback *previous_callback; -} php_imagick_callback; - -/* Globals, needed for the ini settings */ -ZEND_BEGIN_MODULE_GLOBALS(imagick) - zend_bool locale_fix; - zend_bool progress_monitor; - zend_bool skip_version_check; - - zend_bool set_single_thread; - zend_bool allow_zero_dimension_images; - im_long shutdown_sleep_count; - - php_imagick_callback *progress_callback; -#ifdef PHP_IMAGICK_ZEND_MM - MagickWand *keep_alive; -#endif -ZEND_END_MODULE_GLOBALS(imagick) - -#ifdef ZTS -# define IMAGICK_G(v) TSRMG(imagick_globals_id, zend_imagick_globals *, v) -#else -# define IMAGICK_G(v) (imagick_globals.v) -#endif - -ZEND_EXTERN_MODULE_GLOBALS(imagick) - -#ifdef HAVE_LOCALE_H -# if defined(PHP_WIN32) -# define IMAGICK_LC_NUMERIC_LOCALE "English" -# else -# define IMAGICK_LC_NUMERIC_LOCALE "C" -# endif -#endif - -#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3 -#define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") -#endif - - -/* Class names */ -#define PHP_IMAGICK_SC_NAME "Imagick" -#define PHP_IMAGICK_EXCEPTION_SC_NAME "ImagickException" - -#define PHP_IMAGICKDRAW_SC_NAME "ImagickDraw" -#define PHP_IMAGICKDRAW_EXCEPTION_SC_NAME "ImagickDrawException" - -#define PHP_IMAGICKPIXEL_SC_NAME "ImagickPixel" -#define PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME "ImagickPixelException" - -#define PHP_IMAGICKPIXELITERATOR_SC_NAME "ImagickPixelIterator" -#define PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME "ImagickPixelIteratorException" - -#ifdef IMAGICK_WITH_KERNEL -#define PHP_IMAGICKKERNEL_SC_NAME "ImagickKernel" -#define PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME "ImagickKernelException" -#endif - - -#if PHP_VERSION_ID >= 70000 - -/* Structure for Imagick object. */ -typedef struct _php_imagick_object { - MagickWand *magick_wand; - char *progress_monitor_name; - zend_bool next_out_of_bound; - zend_object zo; -} php_imagick_object; - -#else - -/* Structure for Imagick object. */ -typedef struct _php_imagick_object { - zend_object zo; - MagickWand *magick_wand; - char *progress_monitor_name; - zend_bool next_out_of_bound; -} php_imagick_object; - -#endif - - -#if PHP_VERSION_ID >= 70000 - -/* Structure for ImagickDraw object. */ -typedef struct _php_imagickdraw_object { - DrawingWand *drawing_wand; - zend_object zo; -} php_imagickdraw_object; - - -#else - - -/* Structure for ImagickDraw object. */ -typedef struct _php_imagickdraw_object { - zend_object zo; - DrawingWand *drawing_wand; -} php_imagickdraw_object; - - -#endif - -#if PHP_VERSION_ID >= 70000 -
View file
imagick-3.7.0.tgz/imagick-3.7.0/php_imagick_macros.h
Deleted
@@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 / Imagick | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | - | ImageMagick (c) ImageMagick Studio LLC | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Mikko Kopppanen <mkoppanen@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -#ifndef PHP_IMAGICK_MACROS_H -# define PHP_IMAGICK_MACROS_H - -#define IMAGICK_FREE_MAGICK_MEMORY(value) \ - do { \ - if (value) { \ - MagickRelinquishMemory(value); \ - value = NULL; \ - } \ - } while (0) - -#if !defined(E_DEPRECATED) -# define E_DEPRECATED E_STRICT -#endif - -#define IMAGICK_METHOD_DEPRECATED(class_name, method_name) \ - php_error(E_DEPRECATED, "%s::%s method is deprecated and it's use should be avoided", class_name, method_name); - -#define IMAGICK_METHOD_DEPRECATED_USE_INSTEAD(class_name, method_name, new_class, new_method) \ - php_error(E_DEPRECATED, "%s::%s is deprecated. %s::%s should be used instead", class_name, method_name, new_class, new_method); - - -#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(); \ - } - -#endif /* PHP_IMAGICK_MACROS_H */
View file
imagick-3.7.0.tgz/imagick-3.7.0/shim_im6_to_im7.c
Deleted
@@ -1,890 +0,0 @@ - -/* - +----------------------------------------------------------------------+ - | Imagick | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "php_imagick.h" -#include "php_imagick_defs.h" -#include "php_imagick_macros.h" -#include "php_imagick_helpers.h" -#include "php_imagick_file.h" - - -#if MagickLibVersion >= 0x700 - - -// Functions that have been replaced by channel aware versions -MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,const ChannelType channel,const double radius, const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAdaptiveBlurImage(wand, radius, sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, const ChannelType channel, const double radius, const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAdaptiveSharpenImage(wand, radius, sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,const ChannelType channel,const NoiseType noise_type) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - //TODO - what is the value meant to be? - status = MagickAddNoiseImage(wand, noise_type, 1.0); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -// This is not actually an ImageMagick function, but the name is likely to -// avoid any symbol clash for the foreseeable. -MagickBooleanType MagickAddNoiseImageChannelWithAttenuate(MagickWand *wand,const ChannelType channel,const NoiseType noise_type, double attenuate) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAddNoiseImage(wand, noise_type, attenuate); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - - -MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAutoGammaImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, - const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickAutoLevelImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickBlurImageChannel(MagickWand *wand, - const ChannelType channel,const double radius,const double sigma) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickBlurImage(wand, radius,sigma); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,const ChannelType channel,const double brightness, const double contrast) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickBrightnessContrastImage(wand, brightness, contrast); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; -} - -MagickBooleanType MagickClampImageChannel(MagickWand *wand, const ChannelType channel) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - - status = MagickClampImage(wand); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - } - - return status; - -} - -MagickBooleanType MagickClutImageChannel(MagickWand *wand, const ChannelType channel, const MagickWand *clut_wand) { - MagickBooleanType status; - ChannelType previous_channel_mask; - - if (channel != UndefinedChannel) { - previous_channel_mask = MagickSetImageChannelMask(wand, channel); - } - //TODO - need to take parameter - status = MagickClutImage(wand, clut_wand, AverageInterpolatePixel); - - if (channel != UndefinedChannel) { - (void) MagickSetImageChannelMask(wand, previous_channel_mask); - }
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/013-read-filehandle.phpt
Deleted
@@ -1,32 +0,0 @@ ---TEST-- -Imagick::readImageFile test ---SKIPIF-- -<?php - require_once(dirname(__FILE__) . '/skipif.inc'); - checkFormatPresent('jpg'); -?> ---FILE-- -<?php - -$file = dirname(__FILE__) . '/__tmp_rose.jpg'; - -$imagick = new Imagick('magick:rose'); -$imagick->setImageFormat('jpg'); -$imagick->writeImage($file); - -$imagick->clear(); - -$handle = fopen($file, 'rb'); -$imagick->readImageFile($handle); - -unlink($file); - -echo 'success'; - -?> ---CLEAN-- -<?php -@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); -?> ---EXPECT-- -success \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/014-setresourcelimit.phpt
Deleted
@@ -1,68 +0,0 @@ ---TEST-- -Imagick::setResourceLimit test ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x692; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - - -$k = 1024; -$m = $k * $k; -$g = $k * $m; -$t = $k * $g; - -// These tests are flaky as the values ImageMagick will accept -// are limited by the policy.xml of the system. - -$tests = array( - Imagick::RESOURCETYPE_AREA => 100000000, - - // Set maximum amount of disk space in bytes permitted for use by the pixel cache. When this limit is exceeded, the pixel cache is not be created and an error message is returned. - Imagick::RESOURCETYPE_DISK => 100, - - - //Set maximum number of open pixel cache files. When this limit is exceeded, any subsequent pixels cached to disk are closed and reopened on demand. This behavior permits a large number of images to be accessed simultaneously on disk, but with a speed penalty due to repeated open/close calls. - Imagick::RESOURCETYPE_FILE => 100, - - // Set maximum amount of memory map in bytes to allocate for the pixel cache. When this limit is exceeded, the image pixels are cached to disk - Imagick::RESOURCETYPE_MAP => 10 * $g, - - // Set maximum amount of memory in bytes to allocate for the pixel cache from the heap. When this limit is exceeded, the image pixels are cached to memory-mapped disk - Imagick::RESOURCETYPE_MEMORY => 10 * $g, -); - -if (defined('Imagick::RESOURCETYPE_TIME')) { - $testsImagick::RESOURCETYPE_TIME = 30; -} - -if (defined('Imagick::RESOURCETYPE_THROTTLE')) { - $testsImagick::RESOURCETYPE_THROTTLE = 1; -} -if (defined('Imagick::RESOURCETYPE_THREAD')) { - $testsImagick::RESOURCETYPE_THREAD = 1; -} -if (defined('Imagick::RESOURCETYPE_WIDTH')) { - $testsImagick::RESOURCETYPE_WIDTH = $g; -} -if (defined('Imagick::RESOURCETYPE_HEIGHT')) { - $testsImagick::RESOURCETYPE_HEIGHT = $g; -} - -foreach ($tests as $resourceType => $value) { - Imagick::setResourceLimit($resourceType, $value); - $actualValue = Imagick::getResourceLimit($resourceType); - - if ($actualValue != $value) { - echo "Error testing $resourceType, value returned $actualValue is not $value \n"; - } -} - -echo 'success'; - -?> ---EXPECTF-- -success \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/031_Imagick_affineTransformImage_basic.phpt
Deleted
@@ -1,143 +0,0 @@ ---TEST-- -Test Imagick, affineTransformImage ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---XFAIL-- -I don't understand what values are returned in which elements of getImageChannelStatistics ---FILE-- -<?php - - -function checkAllStatsAreValue($channelStatistics, $value) { - - if ($channelStatisticsImagick::CHANNEL_RED'mean' != $value) { - echo "Channel red is wrong " . $channelStatisticsImagick::CHANNEL_RED'mean' . " vs " . $value. "\n"; - } - if ($channelStatisticsImagick::CHANNEL_GREEN'mean' != $value) { - echo "Channel green is wrong " . $channelStatisticsImagick::CHANNEL_GREEN'mean' . " vs " . $value. "\n"; - } - if ($channelStatisticsImagick::CHANNEL_BLUE'mean' != $value) { - echo "Channel blue is wrong " . $channelStatisticsImagick::CHANNEL_BLUE'mean' . " vs " . $value. "\n"; - } - - echo "Stats checked\n"; -} - -function affineTransformImage() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 640, "xc:black"); - $draw = new \ImagickDraw(); - - $angle = deg2rad(45); - //$angle = deg2rad(3); - - $draw->setFillColor('white'); - $draw->setStrokeColor('white'); - $draw->setStrokeWidth(10.0); - $draw->setStrokeLineCap(Imagick::LINECAP_SQUARE); - $draw->setStrokeLineJoin(Imagick::LINEJOIN_BEVEL); - - $draw->line( - $start_x = -50, - $start_y = -50, - $end_x = 690, - $end_y = 690 - ); - - $imagick->drawImage($draw); - - $draw = new \ImagickDraw(); - - $affineRotate = array( - "sx" => cos($angle), "sy" => cos($angle), - "rx" => sin($angle), "ry" => -sin($angle), - "tx" => 0, "ty" => 0, - ); - - $draw->affine($affineRotate); - - $imagick->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_BLACK); - $imagick->affineTransformImage($draw); - $imagick->setImagePage($imagick->getimageWidth(), $imagick->getimageheight(), 0, 0); - - $imagick->cropImage( - $imagick->getImageWidth() - 40, - $imagick->getImageHeight() - 40, - 20, - 20 - ); - - $imagick->setImageFormat('png'); - $imagick->writeImage(__DIR__ . '/test_031.png'); - - - $lineCheckBlack = clone $imagick; - $blackout = new \ImagickDraw(); - $blackout->setStrokeColor('black'); - $blackout->setFillColor('black'); - $blackout->rectangle( - ($lineCheckBlack->getImageWidth() / 2) - 20, - 0, - ($lineCheckBlack->getImageWidth() / 2) + 20, - $lineCheckBlack->getImageHeight() - ); - - $lineCheckBlack->drawImage($blackout); - // $lineCheckBlack->writeImage(__DIR__ . '/test_031_blank.png'); - - $whiteout = new \ImagickDraw(); - $lineCheckWhite = clone $imagick; - $whiteout->setStrokeColor('white'); - $whiteout->setFillColor('white'); - $whiteout->rectangle( - ($lineCheckBlack->getImageWidth() / 2) - 4, - 0, - 0, - $lineCheckBlack->getImageHeight() - ); - $whiteout->rectangle( - ($lineCheckWhite->getImageWidth() / 2) + 4, - 0, - $lineCheckWhite->getImageWidth(), - $lineCheckWhite->getImageHeight() - ); - - $lineCheckWhite->drawImage($whiteout); - // $lineCheckWhite->writeImage(__DIR__ . '/test_031_white.png'); - - $channelStatistics = $lineCheckWhite->getImageChannelStatistics(); - - echo "Checking white\n"; - checkAllStatsAreValue($channelStatistics, Imagick::getQuantum()); - - - $channelStatistics = $lineCheckBlack->getImageChannelStatistics(); -// var_dump( -// "lineCheckBlack channel stats are:", -// $channelStatistics -// ); - - echo "Checking black\n"; - checkAllStatsAreValue($channelStatistics, 0); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -affineTransformImage() ; -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . "/test_031.png"; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Checking white -Stats checked -Checking black -Stats checked -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/042_Imagick_clutImage_basic.phpt
Deleted
@@ -1,28 +0,0 @@ ---TEST-- -Test Imagick, clutImage ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - -function clutImage() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 480, "magick:logo"); - //$imagick->quantizeImage(16, \Imagick::COLORSPACE_YIQ, 8, true, false); - - $clutImagick = new \Imagick(); - $clutImagick->newPseudoImage(640, 480, "magick:NETSCAPE"); - $imagick->clutImage($clutImagick); - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -clutImage() ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/092_Imagick_mergeImageLayers_basic.phpt
Deleted
@@ -1,39 +0,0 @@ ---TEST-- -Test Imagick, mergeImageLayers ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$layerMethodType = 13; - -function mergeImageLayers($layerMethodType) { - - $imagick = new \Imagick(); - $nextImage = null; - $imageNames = array( - "magick:NETSCAPE", - "magick:logo", - "magick:GRANITE", - ); - - foreach ($imageNames as $imageName) { - $nextImage = new \Imagick(); - $nextImage->newPseudoImage(640, 480, $imageName); - $imagick->addImage($nextImage); - } - - $imagick->resetIterator(); - - $imagick->setImageFormat('png'); - - $result = $imagick->mergeImageLayers($layerMethodType); - $bytes = $result->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -mergeImageLayers($layerMethodType); -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/145_imagickkernel_coverage.phpt
Deleted
@@ -1,210 +0,0 @@ ---TEST-- -ImagickKernel::fromMatrix test ---SKIPIF-- -<?php - -$imageMagickRequiredVersion = 0x680; -require_once(dirname(__FILE__) . '/skipif.inc'); - -?> ---FILE-- -<?php - - -$kernel = array( - array(1, 0, -1), - array(1, 0, -1), - array(1, 0, -1), -); - -$kernel = ImagickKernel::fromMatrix($kernel); -$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); -$kernel->addUnityKernel(0.50); -$imagick = new \Imagick(); -$imagick->newPseudoImage(640, 480, "magick:logo"); -$imagick->morphology( - \Imagick::MORPHOLOGY_CONVOLVE, - 1, - $kernel -); - - -$tests = array(); - -$tests = array( - "Cannot create kernel, matrix is empty.", - array() -); - -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array(0, 1, 1) -); - -//Should fail, matrix needs to have same number columns in each row -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array( - array(1, 0, 1), - array(1, 0, 1), - array(1, 0), - ) -); - -//Should fail, value instead of second row -$tests = array( - "Values must be matrix, with the same number of columns in each row.", - array( - array(0, 1), - 1 - ) -); - -//Should fail, value instead of second row -$tests = array( - "Only numbers or false are valid values in a kernel matrix.", - array( - array(0, 1), - array(0, new StdClass), - ) -); - -$tests = array( - "For kernels with even numbered rows or columns, the origin position must be specified.", - array( - array(1, 0), - ), -); - - -foreach ($tests as $test) { - - list($expectedMessage, $testValue) = $test; - - try { - $kernel = ImagickKernel::fromMatrix($testValue); - echo "Failed to throw exception".PHP_EOL; - } - catch(ImagickKernelException $e) { - if ($e->getMessage() != $expectedMessage) { - echo "Unexpected message ".$e->getMessage()." for test:".PHP_EOL; - var_dump($test); - } - } -} - - -try { - $kernel = ImagickKernel::fromBuiltin(\Imagick::KERNEL_DIAMOND, "CestNestPasUneKernel"); - //echo "builtIn OK".PHP_EOL; -} -catch(Exception $e) { - echo "Unexpected exception: ".$e->getMessage().PHP_EOL; -} - - -//Test adding unity kernel works. -$matrix1 = array( - array(1, 1, 1), - array(0, 0, 0), - array(-1, -1, -1), -); -$kernel = ImagickKernel::fromMatrix($matrix1); -$kernel->addUnityKernel(0.5); -$matrix = $kernel->getMatrix(); - -if ($matrix11 != 0.5) { - echo "center point should be 0.5 but is actually ".$matrix11.PHP_EOL; - var_dump($matrix); -} -//echo "Adding unity kernel ok".PHP_EOL; - -// Test adding kernel works and you can get the values back -$matrix1 = array( - array(1, 1), - array(0, 0), -); -$matrix2 = array( - array(0, 0), - array(1, 1), -); -$kernel1 = ImagickKernel::fromMatrix($matrix1, array(0, 0)); -$kernel2 = ImagickKernel::fromMatrix($matrix2, array(0, 0)); -$kernel1->addKernel($kernel2); - -$kernelList = $kernel1->separate(); -if (count($kernelList) != 2) { - echo "Incorrect number of matrixes returned."; -} -else { - if ($kernelList0->getMatrix() != $matrix1) { - echo "Matrix 1 does not match".PHP_EOL; - var_dump($kernelList0); - } - if ($kernelList1->getMatrix() != $matrix2) { - echo "Matrix 2 does not match".PHP_EOL; - var_dump($kernelList1); - } -} - -//Test Scaling -$matrixIn = array( - array(-1, 0, -1), - array( 0, 8, 0), - array(-1, 0, -1), -); -$kernel = ImagickKernel::fromMatrix($matrixIn); -$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); -$matrixOut = $kernel->getMatrix(); - -if ($matrixOut11 != 2) { - echo "Matrix was not normalised correctly."; - var_dump($matrixOut); -} - - - -//Test single line kernel works -$matrixIn = array( - array(1, 0), -); -$kernel = ImagickKernel::fromMatrix($matrixIn, array(1, 0)); -if ($kernel->getMatrix() != $matrixIn) { - echo "Values do not match for 'Test single line kernel works'".PHP_EOL; -} - -//Test even sized kernel works -$matrixIn = array( - array(-1, 0), - array( 0, 1) -); -$kernel = ImagickKernel::fromMatrix($matrixIn, array(0, 1)); -if ($kernel->getMatrix() != $matrixIn) { - echo "Values do not match for 'Test even sized kernel works'".PHP_EOL; -} - -//Test 'wrong' order matrix is converted correctly. -$matrix = array( - array(0.0, 1.0), - array(0.5, false) -); - -$outOfOrderMatrix = array(); -$outOfOrderMatrix11 = $matrix11; -$outOfOrderMatrix10 = $matrix10; -$outOfOrderMatrix01 = $matrix01; -$outOfOrderMatrix00 = $matrix00; - -$kernel = ImagickKernel::fromMatrix($outOfOrderMatrix, array(0, 0)); -$kernelMatrix = $kernel->getMatrix();
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/182_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Deleted
@@ -1,64 +0,0 @@ ---TEST-- -Test ImagickDraw, pathCurveToQuadraticBezierAbsolute ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) { - - $draw = new \ImagickDraw(); - - $draw->setStrokeOpacity(1); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - - $draw->setStrokeWidth(2); - $draw->setFontSize(72); - - $draw->pathStart(); - $draw->pathMoveToAbsolute(50,250); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is the first two params, and the end point is the last two params. - $draw->pathCurveToQuadraticBezierAbsolute( - 150,50, - 250,250 - ); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is mirrored from the previous curves control point - // and the end point is defined by the x, y values. - $draw->pathCurveToQuadraticBezierSmoothAbsolute( - 450,250 - ); - - // This specifies a quadratic bezier curve with the current position as the start - // point, the control point is mirrored from the previous curves control point - // and the end point is defined relative from the current position by the x, y values. - $draw->pathCurveToQuadraticBezierSmoothRelative( - 200,-100 - ); - - $draw->pathFinish(); - - $imagick = new \Imagick(); - $imagick->newImage(700, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} - -} - -pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/187_ImagickDraw_push_basic.phpt
Deleted
@@ -1,41 +0,0 @@ ---TEST-- -Test ImagickDraw, push ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; -$fillModifiedColor = 'LightCoral'; - -function push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) { - - $draw = new \ImagickDraw(); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillModifiedColor); - $draw->setStrokeWidth(2); - $draw->setFontSize(72); - $draw->push(); - $draw->translate(50, 50); - $draw->rectangle(200, 200, 300, 300); - $draw->pop(); - $draw->setFillColor($fillColor); - $draw->rectangle(200, 200, 300, 300); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/188_ImagickDraw_pushPattern_basic.phpt
Deleted
@@ -1,59 +0,0 @@ ---TEST-- -Test ImagickDraw, pushPattern ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function pushPattern($strokeColor, $fillColor, $backgroundColor) { - $draw = new \ImagickDraw(); - - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - $draw->setStrokeWidth(1); - $draw->setStrokeOpacity(1); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - - $draw->setStrokeWidth(1); - - $draw->pushPattern("MyFirstPattern", 0, 0, 50, 50); - for ($x = 0; $x < 50; $x += 10) { - for ($y = 0; $y < 50; $y += 5) { - $positionX = $x + (($y / 5) % 5); - $draw->rectangle($positionX, $y, $positionX + 5, $y + 5); - } - } - $draw->popPattern(); - - $draw->setFillOpacity(0); - $draw->rectangle(100, 100, 400, 400); - $draw->setFillOpacity(1); - - $draw->setFillOpacity(1); - - $draw->push(); - $draw->setFillPatternURL('#MyFirstPattern'); - $draw->setFillColor('yellow'); - $draw->rectangle(100, 100, 400, 400); - $draw->pop(); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -pushPattern($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/192_ImagickDraw_setClipPath_basic.phpt
Deleted
@@ -1,42 +0,0 @@ ---TEST-- -Test ImagickDraw, setClipPath ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - -function setClipPath($strokeColor, $fillColor, $backgroundColor) { - - $draw = new \ImagickDraw(); - $draw->setStrokeColor($strokeColor); - $draw->setFillColor($fillColor); - $draw->setStrokeOpacity(1); - $draw->setStrokeWidth(2); - - $clipPathName = 'testClipPath'; - - $draw->pushClipPath($clipPathName); - $draw->rectangle(0, 0, 250, 250); - $draw->popClipPath(); - $draw->setClipPath($clipPathName); - $draw->rectangle(100, 100, 400, 400); - - $imagick = new \Imagick(); - $imagick->newImage(500, 500, $backgroundColor); - $imagick->setImageFormat("png"); - - $imagick->drawImage($draw); - - $bytes = $imagick->getImageBlob(); - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -setClipPath($strokeColor, $fillColor, $backgroundColor) ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/246_antialias_image.phpt
Deleted
@@ -1,28 +0,0 @@ ---TEST-- -Test pseudo formats ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -$im = new Imagick(); -$im->newPseudoImage(10, 10, "magick:logo"); -//On by default -var_export($im->getAntiAlias()); -echo PHP_EOL; - -//Turn off -$im->setAntiAlias(false); -var_export($im->getAntiAlias()); -echo PHP_EOL; - -//Turn back on -$im->setAntiAlias(true); -var_export($im->getAntiAlias()); -echo PHP_EOL; - -?> ---EXPECTF-- -true -false -true \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/247_ImagickPixelIterator_construct_basic.phpt
Deleted
@@ -1,39 +0,0 @@ ---TEST-- -Test ImagickPixelIterator, construct ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x675; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - - -function construct() { - $imagick = new \Imagick(); - $imagick->newPseudoImage(640, 480, "magick:logo"); - $imageIterator = new \ImagickPixelIterator($imagick); - - /* Loop through pixel rows */ - foreach ($imageIterator as $pixels) { - /* Loop through the pixels in the row (columns) */ - foreach ($pixels as $column => $pixel) { - /** @var $pixel \ImagickPixel */ - if ($column % 2) { - /* Paint every second pixel black*/ - $pixel->setColor("rgba(0, 0, 0, 0)"); - } - } - /* Sync the iterator, this is important to do on each iteration */ - $imageIterator->syncIterator(); - } - - $bytes = $imagick; - if (strlen($bytes) <= 0) { echo "Failed to generate image.";} -} - -construct() ; -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/254_getConfigureOptions.phpt
Deleted
@@ -1,160 +0,0 @@ ---TEST-- -Test Imagick::getConfigureOptions ---SKIPIF-- -<?php - -require_once(dirname(__FILE__) . '/skipif.inc'); - -checkClassMethods('Imagick', array('getconfigureoptions')); - - -?> ---FILE-- -<?php - -$allOptions = Imagick::getConfigureOptions(); - -if (!is_array($allOptions)) { - echo "Failed to return array".PHP_EOL; - var_dump($options); -} -else if (count($allOptions) == 0) { - echo "allOptions is empty".PHP_EOL; -} - - -$optionsStartingWithC = Imagick::getConfigureOptions("Q*"); - -if (!is_array($optionsStartingWithC)) { - echo "Failed to return array".PHP_EOL; - var_dump($optionsStartingWithC); -} -else if (count($optionsStartingWithC) == 0) { - echo "optionsStartingWithC is empty".PHP_EOL; - echo "All options are:\n"; - var_dump(Imagick::getConfigureOptions()); -} - -//Example output on Debian -// -//array(38) { -// "CC"=> -// string(3) "gcc" -// "CFLAGS"=> -// string(186) "-I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -fopenmp -Wall -g -O2 -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" -// "CODER_PATH"=> -// string(56) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders" -// "CONFIGURE"=> -// string(155) "./configure '--with-quantum-depth=16' '--with-magick-plus-plus=no' '--without-perl' '--disable-static' '--disable-docs' '--with-jpeg=yes' '--with-png=yes'" -// "CONFIGURE_PATH"=> -// string(29) "/usr/local/etc/ImageMagick-7/" -// "COPYRIGHT"=> -// string(46) "Copyright (C) 1999-2021 ImageMagick Studio LLC" -// "CPPFLAGS"=> -// string(34) "-I/usr/local/include/ImageMagick-7" -// "CXX"=> -// string(3) "g++" -// "CXXFLAGS"=> -// string(9) " -pthread" -// "DEFS"=> -// string(15) "-DHAVE_CONFIG_H" -// "DELEGATES"=> -// string(33) "freetype jng jpeg png ps xml zlib" -// "DISTCHECK_CONFIG_FLAGS"=> -// string(217) " --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-fftw=no --with-gslib=no --with-fontpath= --with-jxl=no --with-rsvg=no --with-wmf=no --with-perl=no " -// "DOCUMENTATION_PATH"=> -// string(34) "/usr/local/share/doc/ImageMagick-7" -// "EXEC-PREFIX"=> -// string(10) "/usr/local" -// "EXECUTABLE_PATH"=> -// string(14) "/usr/local/bin" -// "FEATURES"=> -// string(22) "DPC HDRI Cipher OpenMP" -// "FILTER_PATH"=> -// string(57) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/filters" -// "GIT_REVISION"=> -// string(24) "18571:309fcfa1c:20210328" -// "HOST"=> -// string(19) "x86_64-pc-linux-gnu" -// "INCLUDE_PATH"=> -// string(32) "/usr/local/include/ImageMagick-7" -// "LDFLAGS"=> -// string(17) "-L/usr/local/lib " -// "LIB_VERSION"=> -// string(5) "0x70B" -// "LIB_VERSION_NUMBER"=> -// string(8) "7,0,11,6" -// "LIBRARY_PATH"=> -// string(33) "/usr/local/lib/ImageMagick-7.0.11" -// "LIBS"=> -// string(96) " -lfreetype -ljpeg -lpng16 -lxml2 -lz -lm -lpthread -lgomp" -// "MAGICK_TEMPORARY_PATH"=> -// string(4) "/tmp" -// "NAME"=> -// string(11) "ImageMagick" -// "PCFLAGS"=> -// string(65) "-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" -// "PREFIX"=> -// string(10) "/usr/local" -// "QuantumDepth"=> -// string(2) "16" -// "RELEASE_DATE"=> -// string(10) "2021-03-28" -// "SHARE_PATH"=> -// string(30) "/usr/local/share/ImageMagick-7" -// "SHAREARCH_PATH"=> -// string(48) "/usr/local/lib/ImageMagick-7.0.11/config-Q16HDRI" -// "TARGET_CPU"=> -// string(6) "x86_64" -// "TARGET_OS"=> -// string(9) "linux-gnu" -// "TARGET_VENDOR"=> -// string(2) "pc" -// "VERSION"=> -// string(6) "7.0.11" -// "WEBSITE"=> -// string(23) "https://imagemagick.org" -//} - - - -// Examples of output on nixos -//array(5) { -// "DELEGATES"=> -// string(102) "bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg lcms lzma openexr png rsvg tiff webp x xml zlib" -// "FEATURES"=> -// string(28) "Cipher DPC HDRI OpenMP(4.5) " -// "MAGICK_TEMPORARY_PATH"=> -// string(4) "/tmp" -// "NAME"=> -// string(11) "ImageMagick" -// "QuantumDepth"=> -// string(3) "Q16" -//} - - - - - - - - -if (!(count($optionsStartingWithC) < count($allOptions))) { - echo ""; - var_dump($optionsStartingWithC); - var_dump($allOptions); -} - -foreach ($optionsStartingWithC as $key => $value) { - $key = strtolower($key); - - if (stripos($key, "q") !== 0) { - echo "key $key does not start with c".PHP_EOL; - } -} - -echo "Ok"; - -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/257_Imagick_setImageChannelMask_basic.phpt
Deleted
@@ -1,37 +0,0 @@ ---TEST-- -Test Imagick, Imagick::exportImagePixels ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x700; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - -$imagick = new \Imagick(); -$imagick->newPseudoImage(256, 256, "gradient:black-white"); - -$initialMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_RED); -$imagick->brightnessContrastImage(-20, 20); -$imagick->setImageFormat("png"); -$imagick->writeImage(__DIR__ . "/maskTest.png"); - -$redMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_DEFAULT); - -if ($initialMask != \Imagick::CHANNEL_DEFAULT) { - echo "initialMask is not equal to \Imagick::CHANNEL_DEFAULT but instead is $initialMask\n"; -} - -if ($redMask != \Imagick::CHANNEL_RED) { - echo "redMask is not equal to \Imagick::CHANNEL_RED but instead is $redMask\n"; -} - -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/maskTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/263_autoGammaImage.phpt
Deleted
@@ -1,22 +0,0 @@ ---TEST-- -Test autoGammaImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('autoGammaImage')); -?> ---FILE-- -<?php - -$im = new Imagick("magick:logo"); -$im->autoGammaImage(); - - -$im = new Imagick("magick:logo"); -$im->autoGammaImage(\Imagick::CHANNEL_RED); - -echo "Ok"; - -?> ---EXPECT-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/264_ImagickDraw_getTextDirection_basic.phpt
Deleted
@@ -1,71 +0,0 @@ ---TEST-- -Test ImagickDraw, getTextDirection ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('ImagickDraw', array('getTextDirection', 'setTextDirection')); -?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/functions.inc'); - -$backgroundColor = 'rgb(225, 225, 225)'; -$strokeColor = 'rgb(0, 0, 0)'; -$fillColor = 'DodgerBlue2'; - - - -$draw = new \ImagickDraw(); -setFontForImagickDraw($draw); - -$draw->setStrokeColor($strokeColor); -$draw->setFillColor($fillColor); - -$draw->setStrokeWidth(2); -$draw->setFontSize(56); - -$directions = array( - \Imagick::DIRECTION_LEFT_TO_RIGHT, - \Imagick::DIRECTION_RIGHT_TO_LEFT, - \Imagick::DIRECTION_LEFT_TO_RIGHT, -); - -$i = 0; -foreach ($directions as $directionToSet) { - $draw->setTextDirection($directionToSet); - $directionReturned = $draw->getTextDirection(); - - if ($directionReturned != $directionToSet) { - echo "Direction error for $i \n"; - } - - $position = 36; - if ($directionToSet == \Imagick::DIRECTION_RIGHT_TO_LEFT) { - $position = 500 - 36; - } - - $draw->annotation($position, (72 * $i) + 64, "Lorem Ipsum!"); - - $i++; -} - -$imagick = new \Imagick(); -$imagick->newImage(500, 500, $backgroundColor); -$imagick->setImageFormat("png"); -$imagick->drawImage($draw); - -$bytes = $imagick->getImageBlob(); -if (strlen($bytes) <= 0) { echo "Failed to generate image.";} - -$imagick->writeImage(__DIR__ . '/directionTest.png'); - -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/directionTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/274_imagick_setImageAlpha.phpt
Deleted
@@ -1,77 +0,0 @@ ---TEST-- -Imagick::setImageAlpha ---SKIPIF-- -<?php -$imageMagickRequiredVersion=0x700; -require_once(dirname(__FILE__) . '/skipif.inc'); -?> ---FILE-- -<?php - -require_once __DIR__ . "/../util/functions.php"; - -$imagick = new Imagick(); -$imagick->newPseudoImage(256, 256, 'xc:purple'); -$imagick->setImageAlpha(0.5); - -$imagick->setImageFormat('png'); -$imagick->writeImage(__DIR__ . "/setAlphaTest.png"); - -$pixelTypes = array( - Imagick::PIXEL_CHAR => array(128, 0, 128, 128), - Imagick::PIXEL_FLOAT => array(0.50196081399918, 0, 0.50196081399918, 0.5), - Imagick::PIXEL_DOUBLE => array(0.50196078431373, 0, 0.50196078431373, 0.5), - Imagick::PIXEL_SHORT => array(32896, 0, 32896, 32768), -); - -function getColorError($type, $expected, $actual) { - - if ($type == Imagick::PIXEL_CHAR || - $type == Imagick::PIXEL_SHORT) { - $string = "Expected: " . $actual . "\n"; - $string .= "Actual : " . $actual . "\n"; - - return $string; - } - - if ($type == Imagick::PIXEL_FLOAT) { - return float_compare_32($expected, $actual); - } - - if ($type == Imagick::PIXEL_DOUBLE) { - return float_compare($expected, $actual); - } - - echo "Unknown type: $type \n"; - exit(-1); -} - - -foreach ($pixelTypes as $pixelType => $expectedValues) { - $pixels = $imagick->exportImagePixels(0, 0, 1, 1, "RGBA", $pixelType); - $channelNames = 'R', 'G', 'B', 'A'; - - // Loop over the colours - for ($channel = 0; $channel < 4; $channel++) { - $actual = $pixels$channel; - $expected = $expectedValues$channel; - if (abs($actual - $expected) > get_epsilon_for_off_by_half_errors()) { - $channelName = $channelNames$channel; - - echo "Pixel values appear incorrect for pixelType $pixelType channel:$channelName\n"; - echo getColorError($pixelType, $expected, $actual); - break; - } - } -} - -echo "Ok"; - -?> ---CLEAN-- -<?php -$f = __DIR__ . '/setAlphaTest.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/278_Imagick_optimaze_gif.phpt
Deleted
@@ -1,86 +0,0 @@ ---TEST-- -Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency ---SKIPIF-- -<?php - -$imageMagickRequiredVersion = 0x686; - -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('optimizeimagelayers')); -checkClassMethods('Imagick', array('optimizeimagetransparency')); - -?> ---FILE-- -<?php - -function makeSimpleGif() { - $aniGif = new \Imagick(); - $aniGif->setFormat("gif"); - - $circleRadius = 20; - $imageFrames = 6; - $imageSize = 200; - - $background = new \Imagick(); - $background->newpseudoimage($imageSize, $imageSize, "canvas:gray"); - - $blackWhite = new \Imagick(); - $blackWhite->newpseudoimage($imageSize, $imageSize, "gradient:black-white"); - - $backgroundPalette = clone $background; - $backgroundPalette->quantizeImage(240, \Imagick::COLORSPACE_RGB, 8, false, false); - - $blackWhitePalette = clone $blackWhite; - $blackWhitePalette->quantizeImage(16, \Imagick::COLORSPACE_RGB, 8, false, false); - - $backgroundPalette->addimage($blackWhitePalette); - - for($count=0 ; $count<$imageFrames ; $count++) { - echo "Frame: ".$count."\n"; - $drawing = new \ImagickDraw(); - $drawing->setFillColor('white'); - $drawing->setStrokeColor('rgba(64, 64, 64, 0.8)'); - $strokeWidth = 4; - $drawing->setStrokeWidth($strokeWidth); - - $distanceToMove = $imageSize + (($circleRadius + $strokeWidth) * 2); - $offset = ($distanceToMove * $count / ($imageFrames -1)) - ($circleRadius + $strokeWidth); - $drawing->translate($offset, ($imageSize / 2) + ($imageSize / 3 * cos(20 * $count / $imageFrames))); - $drawing->circle(0, 0, $circleRadius, 0); - - $frame = clone $background; - $frame->drawimage($drawing); - $frame->clutimage($backgroundPalette); - $frame->setImageDelay(10); - $aniGif->addImage($frame); - } - - $aniGif = $aniGif->deconstructImages(); - - $bytes = $aniGif->getImagesBlob(); - if (strlen($bytes) <= 0) { - echo "Failed to generate image."; - } - - return $aniGif; -} - -function optimizeGif($im) { - $im = $im->coalesceImages(); - $im->optimizeImageLayers(); - $im->optimizeimagetransparency(); -} - -$simpleGif = makeSimpleGif(); -optimizeGif($simpleGif); - -echo "Ok" -?> ---EXPECT-- -Frame: 0 -Frame: 1 -Frame: 2 -Frame: 3 -Frame: 4 -Frame: 5 -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/281_imagick_houghLineImage_basic.phpt
Deleted
@@ -1,36 +0,0 @@ ---TEST-- -Test Imagick, houghLineImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('houghLineImage')); -?> ---FILE-- -<?php - - -function houghLineImage() { - $path = realpath(__DIR__ . '/houghline_input_image.png'); - - if ($path === false) { - echo "Image is not readable.\n"; - exit(-1); - } - - $imagick = new \Imagick(); - $imagick->readImage($path); - $imagick->setbackgroundcolor('rgb(64, 64, 64)'); - $imagick->houghLineImage(20,40, 40); - $imagick->writeImage(__DIR__ . '/houghline_output_image.png'); -} - -houghLineImage() ; -echo "Ok"; -?> ---CLEAN-- -<?php -$f = __DIR__ . '/houghline_output_image.png'; -if (file_exists($f)) unlink($f); -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/289_Imagick_setImageMask_basic.phpt
Deleted
@@ -1,69 +0,0 @@ ---TEST-- -Test Imagick, medianFilterImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('getImageMask', 'setImageMask')); -?> ---FILE-- -<?php - -$canvas = new Imagick(__DIR__ . '/houghline_input_image.png'); - -$mask = new Imagick(); -$mask->newPseudoImage( - $canvas->getImageWidth(), - $canvas->getImageHeight(), - 'xc:black' -); - -$drawing = new ImagickDraw(); -$drawing->setBorderColor('black'); -$drawing->setFillColor('black'); -$drawing->rectangle(0, 0, $mask->getImageWidth(), $mask->getImageHeight()); - -$drawing->setBorderColor('white'); -$drawing->setFillColor('white'); -$drawing->circle( - $mask->getImageWidth() / 2, - $mask->getImageHeight() / 2, - 2 * $mask->getImageWidth() / 3, - $mask->getImageHeight() / 2 -); - -$mask->drawImage($drawing); -//$mask->writeImage(__DIR__ . "/test_mask.png"); - -// This would probably be more useful for users -// but shows the issue with PIXELMASK_COMPOSITE -// $mask->blurImage(10, 2); - -$mask_types = array( - \Imagick::PIXELMASK_READ => "PIXELMASK_READ", - \Imagick::PIXELMASK_WRITE => "PIXELMASK_WRITE", - \Imagick::PIXELMASK_COMPOSITE => "PIXELMASK_COMPOSITE", -); - -$channel_types = array( - \Imagick::CHANNEL_ALL => "CHANNEL_ALL", - \Imagick::CHANNEL_RED => "CHANNEL_RED", - \Imagick::CHANNEL_ALPHA => "CHANNEL_ALPHA", - \Imagick::CHANNEL_RGBA => "CHANNEL_RGBA", - \Imagick::CHANNEL_BLACK => "CHANNEL_BLACK", - \Imagick::CHANNEL_DEFAULT => "CHANNEL_DEFAULT", -); - -foreach ($channel_types as $channel_type => $channel_name) { - foreach ($mask_types as $type => $type_name) { - $output = clone $canvas; - $output->setImageMask($mask, $type); - - $output->blurImage(15, 4, $channel_type); -// $output->writeImage(__DIR__ . "/test_canvas" . $type_name . "_" . $channel_name . ".png"); - } -} - -echo "Ok"; -?> ---EXPECTF-- -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/316_Imagick_getImageKurtosis.phpt
Deleted
@@ -1,27 +0,0 @@ ---TEST-- -Test Imagick, getImageKurtosis ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('getImageKurtosis')); -?> ---FILE-- -<?php - -require_once(__DIR__ . '/functions.inc'); - -function getImageKurtosis() { - $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); - $values = $imagick->getImageKurtosis(); - - check_value($values, "kurtosis", -0.9379261035010518); - check_value($values, "skewness", 0.4562517200972045); -} - -getImageKurtosis() ; -echo "Ok"; -?> ---EXPECTF-- -Value for 'kurtosis' is %f which is close enough to expected %f -Value for 'skewness' is %f which is close enough to expected %f -Ok \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/324_Imagick_polynomialImage.phpt
Deleted
@@ -1,34 +0,0 @@ ---TEST-- -Test Imagick, polynomialImage ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('polynomialImage')); -?> ---FILE-- -<?php - -function polynomialImage() { - $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); - $imagick_gradient = new \Imagick(); - $imagick_gradient->newPseudoImage( - $imagick->getImageWidth(), - $imagick->getImageHeight(), - "gradient:black-white" - ); - - $imagick->addImage($imagick_gradient); - - $terms = 1, 1, 0.1, 0.1; - - // is 2 x (number_terms + 1 (the constant). - $imagick->polynomialImage($terms); - $imagick->writeImage(__DIR__ . '/polynomialImage_output_image.png'); - $imagick->getImageBlob(); -} - -polynomialImage() ; -echo "Ok"; -?> ---EXPECTF-- -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/325_Imagick_setDepth.phpt
Deleted
@@ -1,27 +0,0 @@ ---TEST-- -Test Imagick, setDepth ---SKIPIF-- -<?php -require_once(dirname(__FILE__) . '/skipif.inc'); -checkClassMethods('Imagick', array('setDepth')); -?> ---FILE-- -<?php - -function setDepth() { - $imagick = new \Imagick(); - - $imagick->setDepth(16); - $imagick->newPseudoImage(640, 480, "gradient:red-blue"); - - echo "Depth is " .$imagick->getImageDepth() . "\n"; - - $imagick->getImageBlob(); -} - -setDepth() ; -echo "Ok"; -?> ---EXPECTF-- -Depth is 16 -Ok
View file
imagick-3.7.0.tgz/imagick-3.7.0/tests/functions.inc
Deleted
@@ -1,158 +0,0 @@ -<?php - -/** - * - * Gets the installed version of ImageMagick and compares the - * appropriate version to the installed version. * - * - * @param $testIm6Version - * @param $im7Version - * @return int - */ -function version_compare_imagemagick($testIm6Version, $im7Version) -{ - $versionInfo = \Imagick::getVersion(); - - if (array_key_exists("versionString", $versionInfo) == false) { - die("skip unable to determine ImageMagick version."); - } - - $versionInstalledStringComplete = $versionInfo"versionString"; - - $firstSpace = strpos($versionInstalledStringComplete, ' '); - if ($firstSpace === false) { - die("Failed to understand version string $versionInstalledStringComplete - finding first space"); - } - - $secondSpace = strpos($versionInstalledStringComplete, ' ', $firstSpace + 1); - if ($secondSpace === false) { - die("Failed to understand version string $versionInstalledStringComplete - finding second space"); - } - - $versionInstalledString = substr($versionInstalledStringComplete, $firstSpace + 1, $secondSpace - $firstSpace - 1); - // echo "versionInstalledString is $versionInstalledString \n"; - - $versionToCompare = $im7Version; - if (substr($versionInstalledString, 0, 1) === '6') { - $versionToCompare = $testIm6Version; - } - - return version_compare($versionInstalledString, $versionToCompare); -} - -/** - * - * Compares the installed version of ImageMagick and returns true if the appropriate - * version is greater - * - * @param $testIm6Version - * @param $im7Version - * @return bool - */ -function isVersionGreaterEqual($testIm6Version, $im7Version) -{ - $versionCompare = version_compare_imagemagick($testIm6Version, $im7Version); - // echo "version compare for $testIm6Version, $im7Version is $versionCompare \n"; - - if ($versionCompare >= 0) { - return true; - } - - return false; -} - -/** - * On some systems, where the standard fonts aren't available, trying - * to draw any text fails as the ImageMagick default font is null. - * - * This function just find a 'sensible' font to use, either from the - * preferred list, or just the first one from queryFonts(). That 'probably' - * is the right thing to do, as it makes the tests more stable. - */ -function findDefaultFont() -{ - $knownFonts = - 'Courier', - 'Helvetica', - 'Times-Roman', - 'Liberation-Mono', - 'Utopia', - ; - - $fontList = \Imagick::queryFonts(); - - foreach ($knownFonts as $knownFont) { - - if (in_array($knownFont, $fontList, true) === true) { - return $knownFont; - } - } - - if (count($fontList) !== 0) { - return $fontList0; - } - - throw new \Exception("No fonts available on system, apparently."); -} - -// Find and set a font for the Imagick object -function setFontForImagick(\Imagick $imagick) -{ - $font = findDefaultFont(); - - $imagick->setFont($font); -} - -// Find and set a font for the ImagickDraw object -function setFontForImagickDraw(\ImagickDraw $imagickDraw) -{ - $font = findDefaultFont(); - - $imagickDraw->setFont($font); -} - - -function check_value(array $values, $name, $expected_value) -{ - if (array_key_exists($name, $values) !== true) { - - $message = "Expected key '$name' not set. Array contains:\n"; - $message .= var_export($values, true); - - throw new \Exception($message); - } - - - $value = $values$name; - - $epsilon = 0.01; - - if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { - $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value"; - throw new \Exception($message); - } - - echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; -} - - -function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon) -{ - if (array_key_exists($name, $values) !== true) { - - $message = "Expected key '$name' not set. Array contains:\n"; - $message .= var_export($values, true); - - throw new \Exception($message); - } - - - $value = $values$name; - - if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { - $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value, epsilon = $epsilon"; - throw new \Exception($message); - } - - echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; -} \ No newline at end of file
View file
imagick-3.7.0.tgz/imagick-3.7.0/util/fixup_arginfo.php
Deleted
@@ -1,145 +0,0 @@ -<?php - -declare(strict_types = 1); - - -if ($argc !== 2) { - fwrite(STDERR, "usage php fixup_arginfo.php \$arginfo_filename\n"); - exit(-1); -} - -$filename = $argv1; - -$fixup_note = "file has been fixedup for different versions"; - -echo "Fixing $filename\n"; - -$input_lines = file($filename); - -foreach ($input_lines as $input_line) { - if (strpos($input_line, $fixup_note) !== false) { - echo "File has already been fixedup.\n"; - exit(0); - } -} - -$output_lines = ; - -$search = ; -$replace = ; - -$search = "#.*Stub hash: (.*) .*/#iu"; -$replace = "* Stub hash: regen with 'sh regen_arginfo.sh' \n* $fixup_note */"; - -$search = "#ZEND_ARG_OBJ_INFO\(0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; -$replace = " -#if MAGICKCORE_HDRI_ENABLE - ZEND_ARG_TYPE_INFO(0, $1, IS_DOUBLE, 0) -#else - ZEND_ARG_TYPE_INFO(0, $1, IS_LONG, 0) -#endif -"; - - -// ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) -// ZEND_ARG_INFO(pass_by_ref, name) - -$search = "#ZEND_ARG_TYPE_INFO\((\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO($1, $2, $3, $4) -#else - ZEND_ARG_INFO($1, $2) -#endif"; - -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), 0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; -$replace = " -#if MAGICKCORE_HDRI_ENABLE -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_DOUBLE, 0) -#else -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_LONG, 0) -#endif -"; - - -//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) -#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, $2, $3, $4, $5) -#else -ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ -$search = "#.*ZEND_ARG_TYPE_MASK\((\w|\|*), (\w|\|*), (\w|\|*), (\w\|\"*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_MASK($1, $2, $3, $4) -#else - ZEND_ARG_INFO($1, $2) -#endif -"; - -//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) -//ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) - -$search = "#.*ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX\((\w|\|*), (\w|\|*), (\w|\|*), (\w|\|*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX($1, $2, $3, $4) -#else - ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) -$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX($1, $2, $3, $4, $5) -#else -ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) -#endif -"; - -//ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ -$search = "#.*ZEND_ARG_OBJ_INFO\((\w*), (\w*), resource, (\w*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 -\tZEND_ARG_OBJ_INFO($1, $2, resource, $3) -#else -\tZEND_ARG_INFO($1, $2) -#endif -"; - -// ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") -$search = "#.*ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w*), (\w*), (\w\"*)\)#iu"; -$replace = " -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE($1, $2, $3, $4, $5) -#else - ZEND_ARG_INFO($1, $2) -#endif -"; - - -//#if PHP_VERSION_ID >= 80000 -//ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, NULL) -//#else -// ZEND_ARG_INFO(0, files) -//#endif - - - -foreach ($input_lines as $input_line) { - $input_line = rtrim($input_line); - $input_line = preg_replace($search, $replace, $input_line); - - $output_lines = $input_line; -} - -file_put_contents($filename, implode("\n", $output_lines)); -echo "File has now been fixedup.\n";
View file
imagick-3.8.0.tgz/imagick-3.8.0/CREDITS
Changed
(renamed from imagick-3.7.0/CREDITS)
View file
imagick-3.8.0.tgz/imagick-3.8.0/ChangeLog
Added
@@ -0,0 +1,1175 @@ +3.8.0 +- Fixes: + * Fix signedness formatting mistakes + +3.8.0RC2 +- Fixes: + * Corrected PHP_IMAGICK_EXTNUM + +3.8.0RC1 +- Fixes: + * Imagick::clutImage(...) now respects the images interpolate method. + * You can now pass null to ImagickDraw::setStrokeDashArray() to reset the dash array. + * Fixed memory leak in ImageKernel + * Fixed compiling against PHP 8.4. + * Fixed various reflection issues related to incorrect arginfo +- Added: + * function Imagick::clutImageWithInterpolate(Imagick $lookup_table, int $pixel_interpolate_method): bool {} + * Constants Imagick::COMPRESSION_BC5, Imagick::COMPRESSION_BC7, Imagick::COMPRESSION_LERC, Imagick::DIRECTION_TOP_TO_BOTTOM, Imagick::ALPHACHANNEL_OFF_IF_OPAQUE + +3.7.0 +- Added: + * Imagick::COMPOSITE_SALIENCY_BLEND + +3.7.0RC1 +- Added: + * function Imagick::deleteOption(string $option): bool {} + * function Imagick::getBackgroundColor(): ImagickPixel {} + * function Imagick::getImageArtifacts(string $pattern = "*"): array {} + * function Imagick::getImageKurtosis(): array {} + * function Imagick::getImageMean(): array {} + * function Imagick::getImageRange(): array {} + * function Imagick::getInterpolateMethod(): int {} + * function Imagick::getOptions(string $pattern = "*"): array {} + * function Imagick::getOrientation(): int {} + * function Imagick::getResolution(): array {} + * function Imagick::getType(): int {} + * function Imagick::implodeImageWithMethod(float $radius, int $pixel_interpolate_method): bool {} + * function Imagick::oilPaintImageWithSigma(float $radius, float $sigma) + * function Imagick::polaroidWithTextAndMethod(ImagickDraw $settings, float $angle, string $caption, int $method): bool {} + * function Imagick::polynomialImage(array $terms): bool {} + * function Imagick::setDepth(int $depth): bool {} + * function Imagick::setExtract(string $geometry): bool {} + * function Imagick::setInterpolateMethod(int $method): bool{} + * function Imagick::setOrientation(int $orientation): bool {} + * function Imagick::spreadImageWithMethod(float $radius, int $interpolate_method): bool {} + * function Imagick::swirlImageWithMethod(float $degrees, int $interpolate_method): bool {} + * function Imagick::waveImageWithMethod(float $amplitude, float $length, int $interpolate_method): bool {} + * Imagick::IMAGE_TYPE_BILEVEL + * Imagick::IMAGE_TYPE_GRAYSCALE + * Imagick::IMAGE_TYPE_GRAYSCALE_ALPHA + * Imagick::IMAGE_TYPE_PALETTE + * Imagick::IMAGE_TYPE_PALETTE_ALPHA + * Imagick::IMAGE_TYPE_TRUE_COLOR + * Imagick::IMAGE_TYPE_TRUE_COLOR_ALPHA + * Imagick::IMAGE_TYPE_COLOR_SEPARATION + * Imagick::IMAGE_TYPE_COLOR_SEPARATION_ALPHA + * Imagick::IMAGE_TYPE_OPTIMIZE + * Imagick::IMAGE_TYPE_PALETTE_BILEVEL_ALPHA + * Imagick::COMPOSITE_SEAMLESS_BLEND +- Changed: + * Imagick::setImageArtifact can now take null for the string value. + * Return type for Imagick::getImageArtifact is string|null instead of string. + +3.6.0 + - No change from 3.6.0RC2 + +3.6.0RC2 +- Fixes: + * Remove deprecated message from Imagick::roundCorners() +- Added: + * Imagick::addNoiseImageWithAttenuate() + +3.6.0RC1 + - Imagick::getImageInterlaceScheme is undeprecated. It's the appropriate function to call to get the image interlace setting. + - Image formats are now normalised to lower case. + - Imagick::getImageIndex and Imagick::setImageIndex are undeprecated and work on ImageMagick 7. They call MagickGetIteratorIndex and MagickSetIteratorIndex internally. + - Imagick::averageImages is undeprecated. For IM 7 it now calls EvaluateImages(wand->images,MeanEvaluateOperator). + - Imagick::flattenImages is undeprecated. For IM 7 it now calls MagickMergeImageLayers(intern->magick_wand, FlattenLayer); internally. + - Imagick::getImageSize is undeprecated. For IM 7 it now calls MagickGetImageLength internally. + - Imagick::roundCornersImage is undeprecated and available on IM7. +- Fixes: + * Imagick::borderImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::borderImageWithComposite() instead, which allows you to set the composite method. + * Imagick::frameImage() changed internally to use OverCompositeOp rather than AtopCompositeOp for ImageMagick > 7. If you need the old behaviour, please use Imagick::frameImageWithComposite() instead, which allows you to set the composite method. + * Imagick::profileImage() fixed to allow null as second paramter again. If you can't upgrade to this version yet, pass in "", which has the same effect. + * Imagick::ALPHACHANNEL_COPY and Imagick::ALPHACHANNEL_OPAQUE should be available on IM7. + * Imagick::setImageMatteColor() should be available on IM7. +- Added: + * Imagick::borderImageWithComposite() same as Imagick::borderImage() but allows user to set composite operator used. + * Imagick::frameImageWithComposite() same as Imagick::frameImage() but allows user to set composite operator used. + * function Imagick::cannyEdgeImage + * function Imagick::setSeed + * function Imagick::waveletDenoiseImage + * function Imagick::meanShiftImage + * function Imagick::kmeansImage + * function Imagick::rangeThresholdImage + * function Imagick::autoThresholdImage + * function Imagick::bilateralBlurImage + * function Imagick::claheImage + * function Imagick::channelFxImage + * function Imagick::colorThresholdImage + * function Imagick::complexImages + * function Imagick::interpolativeResizeImage + * function Imagick::levelImageColors + * function Imagick::levelizeImage + * function Imagick::orderedDitherImage + * function Imagick::whiteBalanceImage + +3.5.1 + - No change from 3.5.1RC1 + +3.5.1RC1 + - Better detection of appropriate OpenMP library to use, i.e. GCC or Clang. + +3.5.0 + - Correct parameter for ImagickPixel::getColorValue and ImagickPixel::setIndex. + +3.5.0RC2 + - Fix incorrect parameter defaults, and small fixes on arginfo generation. + +3.5.0RC1 +- ImageMagick 7 is still not widely available on systems. So contrary to previous plans, ImageMagick 6 support will continue for now, but users are recommended to use ImageMagick 7 if possible. +- Method names have been changed to not be all lower case. Both method names and parameter information is built from the Imagick*.stub.php files. +- Prevent accidental creation of zero dimension images. ImageMagick doesn't prevent creation of zero dimension images, but will give an error when that image is used. I don't think this will affect any correctly program, but if it does, and you need to re-enable zero dimension images, please open an issue at https://phpimagick.com/issues +- Various pieces of work have been done to make GOMP not segfault including: + * Call omp_pause_resource_all when available during shutdown. + * Added the 'imagick.shutdown_sleep_count' (default 10) and 'imagick.set_single_thread' (default On). Both of these exist to mitigate the segaults on shutdown. +- Fixes: + * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x + * Imagick::morphology now no longer ignores channel parameter +- Added: + * PHP 8.0 support. + * Location check for ImageMagick 7 for NixOS and Brew. + * Imagick::houghLineImage(int $width, int $height, float $threshold): bool {} + * Imagick::setImagePixelColor(int $x, int $y, ImagickPixel|string $color) + * Imagick::setImageMask(Imagick $clip_mask, int $pixelmask_type) + * Imagick::getImageMask(int $pixelmask_type) + * Imagick::VIRTUALPIXELMETHOD_DITHER + * Imagick::VIRTUALPIXELMETHOD_RANDOM + * Imagick::COMPOSITE_FREEZE + * Imagick::COMPOSITE_INTERPOLATE + * Imagick::COMPOSITE_NEGATE + * Imagick::COMPOSITE_REFLECT + * Imagick::COMPOSITE_SOFTBURN + * Imagick::COMPOSITE_SOFTDODGE + * Imagick::COMPOSITE_STAMP + * Imagick::COMPOSITE_RMSE + * Imagick::COMPRESSION_DWAA + * Imagick::COMPRESSION_DWAB + * Imagick::EVALUATE_INVERSE_LOG + * Imagick::COLORSPACE_DISPLAYP3 + * Imagick::COLORSPACE_ADOBE98 + * Imagick::COLORSPACE_PROPHOTO + * Imagick::COLORSPACE_JZAZBZ + * Imagick::DISTORTION_RIGID_AFFINE + * Imagick::DISTORTION_BARRELINVERSE + * Imagick::STATISTIC_ROOT_MEAN_SQUARE + +3.4.4 +- Fixes: + * Correct version check to make RemoveAlphaChannel and FlattenAlphaChannel be available when using Imagick with ImageMagick version 6.7.8-x + +3.4.4RC2 +- Fixes: + * Correct stability for RC release + * Fix undefined variable for ZTS build + +3.4.4RC1 +- The 3.4.4 release is intended to be the last release (other than small bug fixes) that will support either PHP 5.x, or ImageMagick 6.x. The next planned release will be PHP > 7.0 and ImageMagick > 7.0 at least, if not higher. +- Added: + * function Imagick::optimizeImageTransparency() + * METRIC_STRUCTURAL_SIMILARITY_ERROR + * METRIC_STRUCTURAL_DISSIMILARITY_ERROR + * COMPRESSION_ZSTD - https://github.com/facebook/zstd + * COMPRESSION_WEBP + * CHANNEL_COMPOSITE_MASK + * FILTER_CUBIC_SPLINE - "Define the lobes with the -define filter:lobes={2,3,4} (reference https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=32506)." + * Imagick now explicitly conflicts with the Gmagick extension. +- Fixes: + * Bug 77128 - Imagick::setImageInterpolateMethod() not available on Windows + * Prevent memory leak when ImagickPixel::__construct called after object instantiation. + * Prevent segfault when ImagickPixel internal constructor not called. + * Imagick::setResourceLimit support for values larger than 2GB (2^31) on 32bit platforms. + * Corrected memory overwrite in Imagick::colorDecisionListImage() + * Bug 77791 - ImagickKernel::fromMatrix() out of bounds write. +- Deprecated: + * The following functions have been deprecated: + ImagickDraw, matte + Imagick::averageimages + Imagick::colorfloodfillimage + Imagick::filter + Imagick::flattenimages + Imagick::getimageattribute + Imagick::getimagechannelextrema + Imagick::getimageclipmask + Imagick::getimageextrema + Imagick::getimageindex + Imagick::getimagematte + Imagick::getimagemattecolor + Imagick::getimagesize
View file
imagick-3.8.0.tgz/imagick-3.8.0/Imagick.stub.php
Added
@@ -0,0 +1,1675 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +class Imagick +{ + + public function optimizeImageLayers(): Imagick {} + + // METRIC_* + public function compareImageLayers(int $metric): Imagick {} + + public function pingImageBlob(string $image): bool {} + + // $filehandle should be a resource, but that is a pseudo-type + // which causes problems for people trying to mock the class + public function pingImageFile(/*resource*/mixed $filehandle, ?string $filename = null): bool {} + + public function transposeImage(): bool {} + + public function transverseImage(): bool {} + + public function trimImage(float $fuzz): bool {} + + public function waveImage(float $amplitude, float $length): bool {} + +#if MagickLibVersion >= 0x700 + public function waveImageWithMethod( + float $amplitude, + float $length, + int $interpolate_method // INTERPOLATE_* + ): bool {} +#endif + + public function vignetteImage(float $black_point, float $white_point, int $x, int $y): bool {} + + public function uniqueImageColors(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +// PHP_ME(imagick, getimagematte, imagick_zero_args, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) + /** @deprecated */ + public function getImageMatte(): bool {} +#endif +#endif + + // TODO - enabled? + public function setImageMatte(bool $matte): bool {} + + public function adaptiveResizeImage( + int $columns, + int $rows, + bool $bestfit = false, + bool $legacy = false): bool {} + + public function sketchImage(float $radius, float $sigma, float $angle): bool {} + + public function shadeImage(bool $gray, float $azimuth, float $elevation): bool {} + + public function getSizeOffset(): int {} + + public function setSizeOffset(int $columns, int $rows, int $offset): bool {} + + + public function adaptiveBlurImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function contrastStretchImage( + float $black_point, + float $white_point, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function adaptiveSharpenImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + + public function randomThresholdImage( + float $low, + float $high, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + + + public function roundCornersImage( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + + /** + * @alias Imagick::roundCornersImage + */ + public function roundCorners( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + + public function setIteratorIndex(int $index): bool {} + + public function getIteratorIndex(): int {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function transformImage(string $crop, string $geometry): Imagick {} +#endif + +#if MagickLibVersion > 0x630 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageOpacity(float $opacity): bool {} +#endif +#endif + +#if MagickLibVersion >= 0x700 + public function setImageAlpha(float $alpha): bool {} +#endif + +#if MagickLibVersion < 0x700 + + /** @deprecated */ + public function orderedPosterizeImage( + string $threshold_map, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion >= 0x700 + public function polaroidWithTextAndMethod( + ImagickDraw $settings, + float $angle, + string $caption, + int $method + ): bool {} +#endif + + + public function polaroidImage(ImagickDraw $settings, float $angle): bool {} + + public function getImageProperty(string $name): string {} + + public function setImageProperty(string $name, string $value): bool {} + + public function deleteImageProperty(string $name): bool {} + + // Replaces any embedded formatting characters with the appropriate + // image property and returns the interpreted text. + // See http://www.imagemagick.org/script/escape.php for escape sequences. + // -format "%m:%f %wx%h" + public function identifyFormat(string $format): string {} + + +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + // INTERPOLATE_* + public function setImageInterpolateMethod(int $method): bool {} +#endif + + // why does this not need to be inside the 'if' for IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD ..? + public function getImageInterpolateMethod(): int {} + + public function linearStretchImage(float $black_point, float $white_point): bool {} + + public function getImageLength(): int {} + + public function extentImage(int $width, int $height, int $x, int $y): bool {} + +#if MagickLibVersion > 0x633 + public function getImageOrientation(): int {} + + public function setImageOrientation(int $orientation): bool {} +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion > 0x634 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function paintFloodfillImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif +#endif
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickDraw.stub.php
Added
@@ -0,0 +1,411 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ +class ImagickDraw +{ +#if MagickLibVersion > 0x628 + public function resetVectorGraphics(): bool {} +#endif +#if MagickLibVersion > 0x649 + public function getTextKerning(): float {} + public function setTextKerning(float $kerning): bool {} + public function getTextInterwordSpacing(): float {} + + public function setTextInterwordSpacing(float $spacing): bool {} +#endif +#if MagickLibVersion > 0x655 + public function getTextInterlineSpacing(): float {} + public function setTextInterlineSpacing(float $spacing): bool {} +#endif + + public function __construct() {} + + public function setFillColor(ImagickPixel|string $fill_color): bool {} + + public function setFillAlpha(float $alpha): bool {} + + public function setResolution(float $resolution_x, float $resolution_y): bool {} + + public function setStrokeColor(ImagickPixel|string $color): bool {} + + public function setStrokeAlpha(float $alpha): bool {} + + public function setStrokeWidth(float $width): bool {} + + public function clear(): bool {} + + public function circle( + float $origin_x, + float $origin_y, + float $perimeter_x, + float $perimeter_y + ): bool {} + + public function annotation(float $x, float $y, string $text): bool {} + + public function setTextAntialias(bool $antialias): bool {} + + public function setTextEncoding(string $encoding): bool {} + + public function setFont(string $font_name): bool {} + + public function setFontFamily(string $font_family): bool {} + + public function setFontSize(float $point_size): bool {} + + // STYLE_* + public function setFontStyle(int $style): bool {} + + /** + * $weight font weight (valid range 100-900) + */ + public function setFontWeight(int $weight): bool {} + + public function getFont(): string {} + + public function getFontFamily(): string {} + + public function getFontSize(): float {} + + public function getFontStyle(): int {} + + public function getFontWeight(): int {} + + /** @alias ImagickDraw::clear */ + public function destroy(): bool {} + + public function rectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y): bool {} + + public function roundRectangle(float $top_left_x, float $top_left_y, float $bottom_right_x, float $bottom_right_y, float $rounding_x, float $rounding_y): bool {} + + + //ox + //origin x ordinate + //oy + //origin y ordinate + //rx + //radius in x + //ry + //radius in y + //start + //starting rotation in degrees + //end + //ending rotation in degrees + + public function ellipse(float $origin_x, float $origin_y, float $radius_x, float $radius_y, float $angle_start, float $angle_end): bool {} + + public function skewX(float $degrees): bool {} + + public function skewY(float $degrees): bool {} + + public function translate(float $x, float $y): bool {} + + public function line(float $start_x, float $start_y, float $end_x, float $end_y): bool {} + + +//sx +//starting x ordinate of bounding rectangle +//sy +//starting y ordinate of bounding rectangle +//ex +//ending x ordinate of bounding rectangle +//ey +//ending y ordinate of bounding rectangle +//sd +//starting degrees of rotation +//ed +//ending degrees of rotation + + public function arc( + float $start_x, + float $start_y, + float $end_x, + float $end_y, + float $start_angle, + float $end_angle + ): bool {} + +#if MagickLibVersion >= 0x700 + // PAINT_* + public function alpha(float $x, float $y, int $paint): bool {} +#else + /** @deprecated */ + // PAINT_* + public function matte(float $x, float $y, int $paint): bool {} +#endif + + public function polygon(array $coordinates): bool {} + + public function point(float $x, float $y): bool {} + + public function getTextDecoration(): int {} + + public function getTextEncoding(): false|string {} + + public function getFontStretch(): int {} + + // STRETCH_* font_stretch + public function setFontStretch(int $stretch): bool {} + + public function setStrokeAntialias(bool $enabled): bool {} + + // ALIGN_* + public function setTextAlignment(int $align): bool {} + + // DECORATION_* + public function setTextDecoration(int $decoration): bool {} + + public function setTextUnderColor(ImagickPixel|string $under_color): bool {} + + public function setViewbox(int $left_x, int $top_y, int $right_x, int $bottom_y): bool {} + + public function clone(): ImagickDraw {} + + public function affine(array $affine): bool {} + + public function bezier(array $coordinates): bool {} + + // COMPOSITE_* + public function composite( + int $composite, + float $x, + float $y, + float $width, + float $height, + Imagick $image + ): bool {} + + // PAINT_* + public function color(float $x, float $y, int $paint): bool {} + + public function comment(string $comment): bool {} + + public function getClipPath(): false|string {} + + public function getClipRule(): int {} + + public function getClipUnits(): int {} + + public function getFillColor(): ImagickPixel {} + + public function getFillOpacity(): float {} + + public function getFillRule(): int {} + + public function getGravity(): int {} +
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickDraw_arginfo.h
Added
@@ -0,0 +1,1954 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +#if MagickLibVersion > 0x628 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_resetVectorGraphics, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextKerning, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextKerning, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, kerning, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, kerning) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x649 +#define arginfo_class_ImagickDraw_getTextInterwordSpacing arginfo_class_ImagickDraw_getTextKerning +#endif + +#if MagickLibVersion > 0x649 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterwordSpacing, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, spacing) +#endif +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_getTextInterlineSpacing, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if MagickLibVersion > 0x655 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setTextInterlineSpacing, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, spacing, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, spacing) +#endif +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, fill_color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setFillAlpha, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, alpha, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, alpha) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setResolution, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, resolution_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, resolution_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, resolution_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, resolution_y) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeColor, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickDraw_setStrokeAlpha arginfo_class_ImagickDraw_setFillAlpha + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_setStrokeWidth, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, width, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, width) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickDraw_circle, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_x, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, origin_y, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, origin_y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, perimeter_x, IS_DOUBLE, 0)
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickKernel.stub.php
Added
@@ -0,0 +1,28 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +#ifdef IMAGICK_WITH_KERNEL +class ImagickKernel +{ + public function addKernel(ImagickKernel $kernel): void {} + + public function addUnityKernel(float $scale): void {} + + // KERNEL_* + public static function fromBuiltin(int $kernel, string $shape): ImagickKernel {} + + public static function fromMatrix(array $matrix, ?array $origin = null): ImagickKernel {} + + public function getMatrix(): array {} + + // NORMALIZE_KERNEL_ + public function scale(float $scale, ?int $normalize_kernel = null): void {} + + public function separate(): array {} +} +#endif +
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickKernel_arginfo.h
Added
@@ -0,0 +1,155 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addKernel, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, kernel, ImagickKernel, 0) +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_addUnityKernel, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, scale) +#endif +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 2, ImagickKernel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromBuiltin, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, kernel, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, kernel) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, shape, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, shape) +#endif +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 1, ImagickKernel, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_fromMatrix, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, matrix, IS_ARRAY, 0) +#else + ZEND_ARG_INFO(0, matrix) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, origin, IS_ARRAY, 1, "null") +#else + ZEND_ARG_INFO(0, origin) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_getMatrix, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 1, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickKernel_scale, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, scale) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalize_kernel, IS_LONG, 1, "null") +#else + ZEND_ARG_INFO(0, normalize_kernel) +#endif + +ZEND_END_ARG_INFO() +#endif + +#if defined(IMAGICK_WITH_KERNEL) +#define arginfo_class_ImagickKernel_separate arginfo_class_ImagickKernel_getMatrix +#endif + + +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, addKernel); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, addUnityKernel); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, fromBuiltin); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, fromMatrix); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, getMatrix); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, scale); +#endif +#if defined(IMAGICK_WITH_KERNEL) +ZEND_METHOD(ImagickKernel, separate); +#endif + + +#if defined(IMAGICK_WITH_KERNEL) +static const zend_function_entry class_ImagickKernel_methods = { + ZEND_ME(ImagickKernel, addKernel, arginfo_class_ImagickKernel_addKernel, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, addUnityKernel, arginfo_class_ImagickKernel_addUnityKernel, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, fromBuiltin, arginfo_class_ImagickKernel_fromBuiltin, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(ImagickKernel, fromMatrix, arginfo_class_ImagickKernel_fromMatrix, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(ImagickKernel, getMatrix, arginfo_class_ImagickKernel_getMatrix, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, scale, arginfo_class_ImagickKernel_scale, ZEND_ACC_PUBLIC) + ZEND_ME(ImagickKernel, separate, arginfo_class_ImagickKernel_separate, ZEND_ACC_PUBLIC) + ZEND_FE_END +}; +#endif \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixel.stub.php
Added
@@ -0,0 +1,86 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ + +class ImagickPixel +{ + public function __construct(?string $color = null) {} + + public function clear(): bool {} + + /** @alias ImagickPixel::clear */ + public function destroy(): bool {} + + public function getColor(int $normalized = 0): array {} + + public function getColorAsString(): string {} + + public function getColorCount(): int {} + + public function getColorQuantum(): array {} + + // COLOR_* + public function getColorValue(int $color): float {} + + /** + * $color // COLOR_* + * return + * - Float if IM compiled with HDRI + * - int if IM compiled with fixed point math + */ + public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {} + + public function getHSL(): array {} + + public function getIndex(): int {} + + public function isPixelSimilar(ImagickPixel|string $color, float $fuzz): ?bool {} + + // The fuzz value should be in the range 0-QuantumRange. The maximum value + // represents the longest possible distance in the colorspace. e.g. from + // RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace + public function isPixelSimilarQuantum(ImagickPixel|string $color, float $fuzz_quantum_range_scaled_by_square_root_of_three): ?bool {} + + /** @alias ImagickPixel::isPixelSimilarQuantum */ + + public function isSimilar( + ImagickPixel|string $color, + // Feel free to not use named params for this. + float $fuzz_quantum_range_scaled_by_square_root_of_three + ): ?bool{} + + public function setColor(string $color): bool {} + + public function setColorCount(int $color_count): bool {} + + // COLOR_* + public function setColorValue(int $color, float $value): bool {} + + /** + * $color // COLOR_* + * $value + * + * Type of value depends on how ImageMagick was compiled. + * - Float if IM compiled with HDRI + * - int if IM compiled with fixed point math + * + */ + public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{} + + public function setHSL(float $hue, float $saturation , float $luminosity): bool{} + + // This function could be described more clearly... + // https://imagemagick.org/api/pixel-wand.php#PixelSetIndex + public function setIndex(IMAGICK_QUANTUM_TYPE $index): bool {} + + //// Not in docs. +#if MagickLibVersion >= 0x693 + public function setColorFromPixel(ImagickPixel $pixel): bool {} +#endif +} + + +
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixelIterator.stub.php
Added
@@ -0,0 +1,63 @@ +<?php + +/** + * @generate-function-entries + * @generate-legacy-arginfo 70000 + */ +class ImagickPixelIterator { + public function __construct(Imagick $imagick) {} + + public function clear(): bool {} + + public static function getPixelIterator(Imagick $imagick) : ImagickPixelIterator {} + + public static function getPixelRegionIterator( + Imagick $imagick, + int $x, + int $y, + int $columns, + int $rows): ImagickPixelIterator {} + + + /** @alias ImagickPixelIterator::clear */ + public function destroy(): bool {} + + public function getCurrentIteratorRow(): ?array {} + + public function getIteratorRow(): int {} + + public function getNextIteratorRow(): ?array {} + + public function getPreviousIteratorRow(): array {} + + /** @alias ImagickPixelIterator::getIteratorRow */ + public function key(): int {} + + public function next(): void {} + + public function rewind(): void {} + + /** @alias ImagickPixelIterator::getCurrentIteratorRow */ + public function current(): ?array {} + + public function newPixelIterator(Imagick $imagick): bool {} + + public function newPixelRegionIterator( + Imagick $imagick, + int $x, + int $y, + int $columns, + int $rows): bool {} + + public function resetIterator(): bool {} + + public function setIteratorFirstRow(): bool {} + + public function setIteratorLastRow(): bool {} + + public function setIteratorRow(int $row): bool {} + + public function syncIterator(): bool {} + + public function valid(): bool {} +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixelIterator_arginfo.h
Added
@@ -0,0 +1,221 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator___construct, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 1, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelIterator, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 5, ImagickPixelIterator, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPixelRegionIterator, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_destroy arginfo_class_ImagickPixelIterator_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getCurrentIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_getNextIteratorRow arginfo_class_ImagickPixelIterator_getCurrentIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_getPreviousIteratorRow, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_key arginfo_class_ImagickPixelIterator_getIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, IS_VOID, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_next, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_rewind arginfo_class_ImagickPixelIterator_next + +#define arginfo_class_ImagickPixelIterator_current arginfo_class_ImagickPixelIterator_getCurrentIteratorRow + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelIterator, 0, 0, 1) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 5, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_newPixelRegionIterator, 0, 0, 5) +#endif + + ZEND_ARG_OBJ_INFO(0, imagick, Imagick, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, columns, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, columns) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, rows, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, rows) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_resetIterator arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_setIteratorFirstRow arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_setIteratorLastRow arginfo_class_ImagickPixelIterator_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixelIterator_setIteratorRow, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, row, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, row) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixelIterator_syncIterator arginfo_class_ImagickPixelIterator_clear + +#define arginfo_class_ImagickPixelIterator_valid arginfo_class_ImagickPixelIterator_clear + + +ZEND_METHOD(ImagickPixelIterator, __construct); +ZEND_METHOD(ImagickPixelIterator, clear); +ZEND_METHOD(ImagickPixelIterator, getPixelIterator); +ZEND_METHOD(ImagickPixelIterator, getPixelRegionIterator); +ZEND_METHOD(ImagickPixelIterator, getCurrentIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getNextIteratorRow); +ZEND_METHOD(ImagickPixelIterator, getPreviousIteratorRow); +ZEND_METHOD(ImagickPixelIterator, next); +ZEND_METHOD(ImagickPixelIterator, rewind); +ZEND_METHOD(ImagickPixelIterator, newPixelIterator); +ZEND_METHOD(ImagickPixelIterator, newPixelRegionIterator); +ZEND_METHOD(ImagickPixelIterator, resetIterator); +ZEND_METHOD(ImagickPixelIterator, setIteratorFirstRow); +ZEND_METHOD(ImagickPixelIterator, setIteratorLastRow); +ZEND_METHOD(ImagickPixelIterator, setIteratorRow); +ZEND_METHOD(ImagickPixelIterator, syncIterator); +ZEND_METHOD(ImagickPixelIterator, valid); + + +static const zend_function_entry class_ImagickPixelIterator_methods = { + ZEND_ME(ImagickPixelIterator, __construct, arginfo_class_ImagickPixelIterator___construct, ZEND_ACC_PUBLIC)
View file
imagick-3.8.0.tgz/imagick-3.8.0/ImagickPixel_arginfo.h
Added
@@ -0,0 +1,346 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel___construct, 0, 0, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, color, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, color) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_clear, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_destroy arginfo_class_ImagickPixel_clear + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColor, 0, 0, 0) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, normalized, IS_LONG, 0, "0") +#else + ZEND_ARG_INFO(0, normalized) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorAsString, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorCount, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorQuantum, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 1, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValue, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + + +#if MAGICKCORE_HDRI_ENABLE + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) +#endif + +#else + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_getColorValueQuantum, 0, 0, 1) +#endif + +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_getHSL arginfo_class_ImagickPixel_getColorQuantum + +#define arginfo_class_ImagickPixel_getIndex arginfo_class_ImagickPixel_getColorCount + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 2, _IS_BOOL, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilar, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 2, _IS_BOOL, 1) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_isPixelSimilarQuantum, 0, 0, 2) +#endif + + ZEND_ARG_OBJ_TYPE_MASK(0, color, ImagickPixel, MAY_BE_STRING, NULL) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz_quantum_range_scaled_by_square_root_of_three) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_ImagickPixel_isSimilar arginfo_class_ImagickPixel_isPixelSimilarQuantum + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColor, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, color) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorCount, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color_count, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color_count) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ImagickPixel_setColorValue, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, color, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, color) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() +
View file
imagick-3.8.0.tgz/imagick-3.8.0/Imagick_arginfo.h
Added
@@ -0,0 +1,7365 @@ +/* This is a generated file, edit the .stub.php file instead. +* Stub hash: regen with 'sh regen_arginfo.sh' +* file has been fixedup for different versions */ + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_optimizeImageLayers, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 1, Imagick, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_compareImageLayers, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, metric, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, metric) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageBlob, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, image, IS_STRING, 0) +#else + ZEND_ARG_INFO(0, image) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_pingImageFile, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, filehandle, IS_MIXED, 0) +#else + ZEND_ARG_INFO(0, filehandle) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +#else + ZEND_ARG_INFO(0, filename) +#endif + +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_transposeImage, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_transposeImage, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_transverseImage arginfo_class_Imagick_transposeImage + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_trimImage, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_trimImage, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, fuzz, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, fuzz) +#endif +ZEND_END_ARG_INFO() + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImage, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImage, 0, 0, 2) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, amplitude) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, length) +#endif +ZEND_END_ARG_INFO() + +#if MagickLibVersion >= 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_waveImageWithMethod, 0, 0, 3) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, amplitude, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, amplitude) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, length, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, length) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, interpolate_method, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, interpolate_method) +#endif +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_vignetteImage, 0, 0, 4) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, black_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, black_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, white_point, IS_DOUBLE, 0) +#else + ZEND_ARG_INFO(0, white_point) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, x) +#endif + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, y, IS_LONG, 0) +#else + ZEND_ARG_INFO(0, y) +#endif +ZEND_END_ARG_INFO() + +#define arginfo_class_Imagick_uniqueImageColors arginfo_class_Imagick_transposeImage + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) && MagickLibVersion < 0x700 + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_getImageMatte, 0, 0, 0) +#endif + +ZEND_END_ARG_INFO() +#endif + + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Imagick_setImageMatte, 0, 0, 1) +#endif + + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO(0, matte, _IS_BOOL, 0) +#else + ZEND_ARG_INFO(0, matte)
View file
imagick-3.8.0.tgz/imagick-3.8.0/LICENSE
Changed
(renamed from imagick-3.7.0/LICENSE)
View file
imagick-3.8.0.tgz/imagick-3.8.0/config.m4
Added
@@ -0,0 +1,111 @@ +PHP_ARG_WITH(imagick, whether to enable the imagick extension, + --with-imagick=DIR Enables the imagick extension. DIR is the prefix to ImageMagick installation directory., no) + + +if test $PHP_IMAGICK != "no"; then + +# +# Find ImageMagick +# +if test "$ext_shared" != "yes" && test "$ext_shared" != "shared"; then + define('PHP_IMAGICK_STATIC', 1) + PHP_IMAGICK_STATIC=yes +fi +m4_include(ifdef('PHP_IMAGICK_STATIC',PHP_EXT_BUILDDIR(imagick)/,)imagemagick.m4) + +# This line checks that ImageMagick is available, and +# meets our minimum supported version. TODO change to 6.7.0 +IM_FIND_IMAGEMAGICK(6.5.3, $PHP_IMAGICK) + +# +# PHP minimum version +# + AC_MSG_CHECKING(PHP version is at least 5.6.0) + + if test -z "${PHP_VERSION_ID}"; then + if test -z "${PHP_CONFIG}"; then + AC_MSG_ERROR(php-config not found) + fi + if test -z "${AWK}"; then + AC_MSG_ERROR(awk not found) + fi + PHP_IMAGICK_FOUND_VERSION=`${PHP_CONFIG} --version` + PHP_IMAGICK_FOUND_VERNUM=`echo "${PHP_IMAGICK_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 100 + $2) * 100 + $3;}'` + else + PHP_IMAGICK_FOUND_VERNUM="${PHP_VERSION_ID}" + PHP_IMAGICK_FOUND_VERSION="${PHP_VERSION}" + fi + + if test "$PHP_IMAGICK_FOUND_VERNUM" -ge "50600"; then + AC_MSG_RESULT(yes. found $PHP_IMAGICK_FOUND_VERSION) + else + AC_MSG_ERROR(no. found $PHP_IMAGICK_FOUND_VERSION) + fi + +# +# Set libs and CFLAGS for building +# + echo "libs" + echo $IM_IMAGEMAGICK_LIBS + echo "" + echo $IMAGICK_SHARED_LIBADD + + PHP_EVAL_LIBLINE($IM_IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD) + PHP_EVAL_INCLINE($IM_IMAGEMAGICK_CFLAGS) + + old_LIBS=$LIBS + LIBS="$LIBS $IM_IMAGEMAGICK_LIBS" + + PHP_CHECK_FUNC(MagickGetVersion) + + LIBS=$old_LIBS + + AC_MSG_CHECKING(omp_pause_resource_all usability) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM( + #include <omp.h> + , + omp_pause_resource_all(omp_pause_hard); + ), + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(Which flavour of OpenMP to link) + + if test "${GCC}" = "yes"; then + # Open64 (passes for GCC but uses different OpenMP implementation) + if test "x$GOMP_LIBS" = x ; then + if $CC --version 2>&1 | grep Open64 > /dev/null ; then + PHP_CHECK_FUNC(omp_pause_resource_all, openmp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(openmp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(Open64 flavoured OpenMP) + fi + fi + fi + # Clang (passes for GCC but uses different OpenMP implementation) + if test "x$LIB_OMP" = x ; then + if $CC --version 2>&1 | grep clang > /dev/null ; then + PHP_CHECK_FUNC(omp_pause_resource_all, omp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(omp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(Clang flavoured OpenMP) + fi + fi + fi + # GCC + if test "x$ac_cv_func_omp_pause_resource_all" = x ; then + PHP_CHECK_FUNC(omp_pause_resource_all, gomp) + if test "x$ac_cv_func_omp_pause_resource_all" = "xyes"; then + PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD) + AC_MSG_RESULT(GCC flavoured OpenMP) + fi + fi + fi + + , + AC_MSG_RESULT(no) + ) + + 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) + PHP_INSTALL_HEADERS(ext/imagick, php_imagick_shared.h) +fi
View file
imagick-3.8.0.tgz/imagick-3.8.0/config.w32
Changed
(renamed from imagick-3.7.0/config.w32)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/captcha.php
Changed
(renamed from imagick-3.7.0/examples/captcha.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/polygon.php
Changed
(renamed from imagick-3.7.0/examples/polygon.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/thumbnail.php
Changed
(renamed from imagick-3.7.0/examples/thumbnail.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/examples/watermark.php
Changed
(renamed from imagick-3.7.0/examples/watermark.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagemagick.m4
Changed
(renamed from imagick-3.7.0/imagemagick.m4)
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick.c
Added
@@ -0,0 +1,1332 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_shared.h" + +#if PHP_VERSION_ID >= 70000 +#include "ext/standard/php_smart_string.h" +#else +#include "ext/standard/php_smart_str.h" +#endif + +#if PHP_VERSION_ID < 70200 +///* For the countable interface */ +#include "ext/spl/spl_iterators.h" +#endif + +#include "shim_php7_to_php8.h" + +#if HAVE_OMP_PAUSE_RESOURCE_ALL +#include <omp.h> +#endif + +ZEND_DECLARE_MODULE_GLOBALS(imagick) + +#ifdef IMAGICK_WITH_KERNEL + #if PHP_VERSION_ID >= 80000 + HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC); /* {{{ */ + #else + HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC); /* {{{ */ + #endif +#endif + +#if MAGICKCORE_HDRI_ENABLE + #define IMAGICK_QUANTUM_TYPE IS_DOUBLE +#else + #define IMAGICK_QUANTUM_TYPE IS_LONG +#endif + +zend_class_entry *php_imagick_sc_entry; +zend_class_entry *php_imagick_exception_class_entry; +zend_class_entry *php_imagickdraw_sc_entry; +zend_class_entry *php_imagickdraw_exception_class_entry; +zend_class_entry *php_imagickpixel_sc_entry; +zend_class_entry *php_imagickpixel_exception_class_entry; +zend_class_entry *php_imagickpixeliterator_sc_entry; +zend_class_entry *php_imagickpixeliterator_exception_class_entry; +#ifdef IMAGICK_WITH_KERNEL +zend_class_entry *php_imagickkernel_sc_entry; +zend_class_entry *php_imagickkernel_exception_class_entry; +#endif + +#if defined(ZTS) && defined(PHP_WIN32) +static MUTEX_T imagick_mutex; +static THREAD_T imagick_thread_id; +#endif + +/* Handlers */ +static zend_object_handlers imagick_object_handlers; +static zend_object_handlers imagickdraw_object_handlers; +static zend_object_handlers imagickpixel_object_handlers; +static zend_object_handlers imagickpixeliterator_object_handlers; +#ifdef IMAGICK_WITH_KERNEL +static zend_object_handlers imagickkernel_object_handlers; +#endif + +/* External API */ +PHP_IMAGICK_API zend_class_entry *php_imagick_get_class_entry() +{ + return php_imagick_sc_entry; +} + +PHP_IMAGICK_API zend_class_entry *php_imagickdraw_get_class_entry() +{ + return php_imagickdraw_sc_entry; +} + +PHP_IMAGICK_API zend_class_entry *php_imagickpixel_get_class_entry() +{ + return php_imagickpixel_sc_entry; +} + +static zend_function_entry php_imagick_functions = +{ + PHP_FE_END, +}; + + +#include "ImagickDraw_arginfo.h" +const zend_function_entry *php_imagickdraw_class_methods = class_ImagickDraw_methods; + +#include "ImagickPixelIterator_arginfo.h" +const zend_function_entry *php_imagickpixeliterator_class_methods = class_ImagickPixelIterator_methods; + +#include "ImagickPixel_arginfo.h" +const zend_function_entry *php_imagickpixel_class_methods = class_ImagickPixel_methods; + +#include "Imagick_arginfo.h" +const zend_function_entry *php_imagick_class_methods = class_Imagick_methods; + +#ifdef IMAGICK_WITH_KERNEL +#include "ImagickKernel_arginfo.h" +const zend_function_entry *php_imagickkernel_class_methods = class_ImagickKernel_methods; +#endif + +static void php_imagick_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagick_object *intern = php_imagick_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->progress_monitor_name) { + //TODO - is this meant to be free by us? + efree(intern->progress_monitor_name); + } + + if (intern->magick_wand != NULL) { + intern->magick_wand = DestroyMagickWand(intern->magick_wand); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); +#if PHP_VERSION_ID < 70000 + efree(intern); +#endif +} + + +static void php_imagickdraw_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickdraw_object *intern = php_imagickdraw_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->drawing_wand != NULL) { + intern->drawing_wand = DestroyDrawingWand(intern->drawing_wand); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); + + #if PHP_VERSION_ID < 70000 + efree(intern); + #endif +} + +static void php_imagickpixeliterator_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickpixeliterator_object *intern = php_imagickpixeliterator_fetch_object(object); + + if (!intern) { + return; + } + + if (intern->pixel_iterator != NULL) { + intern->pixel_iterator = DestroyPixelIterator(intern->pixel_iterator); + } + + zend_object_std_dtor(&intern->zo TSRMLS_CC); + #if PHP_VERSION_ID < 70000 + efree(intern); + #endif +} + + + +static void php_imagickpixel_object_free_storage(IM_ZEND_OBJECT *object TSRMLS_DC) +{ + php_imagickpixel_object *intern = php_imagickpixel_fetch_object(object); + + if (!intern) { + return; + } + if (!intern->initialized_via_iterator && intern->pixel_wand) + intern->pixel_wand = DestroyPixelWand(intern->pixel_wand); + + zend_object_std_dtor(&intern->zo TSRMLS_CC);
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_class.c
Added
@@ -0,0 +1,14241 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_file.h" + + +#if MagickLibVersion > 0x628 +/* {{{ proto bool Imagick::pingImageFile(resource filehandle) + Query image information without reading the whole image to memory +*/ +PHP_METHOD(Imagick, pingImageFile) +{ + char *filename = NULL; + IM_LEN_TYPE filename_len; + php_imagick_object *intern; + zval *zstream; + php_stream *stream; + zend_bool result; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!", &zstream, &filename, &filename_len) == FAILURE) + { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + +#if PHP_VERSION_ID >= 70000 + php_stream_from_zval(stream, zstream); +#else + php_stream_from_zval(stream, &zstream); +#endif + result = php_imagick_stream_handler(intern, stream, ImagickPingImageFile TSRMLS_CC); + + if (result == 0) { + if (!EG(exception)) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image from the filehandle" TSRMLS_CC); + } + RETURN_THROWS(); + } + + if (filename) { + MagickSetImageFilename(intern->magick_wand, filename); + MagickSetLastIterator(intern->magick_wand); + } + RETURN_TRUE; +} +/* }}} */ + + +/* {{{ proto bool Imagick::pingImageBlob(string image ) + Query image information without reading the whole image to memory +*/ +PHP_METHOD(Imagick, pingImageBlob) +{ + char *image_string; + IM_LEN_TYPE image_string_len; + MagickBooleanType status; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &image_string, &image_string_len) == FAILURE) { + RETURN_THROWS(); + } + + if (image_string_len == 0) { + php_imagick_throw_exception(IMAGICK_CLASS, "Empty image string passed" TSRMLS_CC); + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + status = MagickPingImageBlob(intern->magick_wand, image_string, image_string_len); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to ping image blob" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::vignetteImage(float blackPoint, float whitePoint, int x, int y ) + Adds vignette filter to the image +*/ +PHP_METHOD(Imagick, vignetteImage) +{ + double black_point, white_point; + im_long x, y; + php_imagick_object *intern; + MagickBooleanType status; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddll", &black_point, &white_point, &x, &y) == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickVignetteImage(intern->magick_wand, black_point, white_point, x, y); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to apply vignette filter" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::transposeImage() + Creates a vertical mirror image +*/ +PHP_METHOD(Imagick, transposeImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTransposeImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transpose image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::transverseImage() + Creates a horizontal mirror image +*/ +PHP_METHOD(Imagick, transverseImage) +{ + php_imagick_object *intern; + MagickBooleanType status; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + intern = Z_IMAGICK_P(getThis()); + IMAGICK_NOT_EMPTY(intern); + + status = MagickTransverseImage(intern->magick_wand); + + /* No magick is going to happen */ + if (status == MagickFalse) { + php_imagick_convert_imagick_exception(intern->magick_wand, "Unable to transverse image" TSRMLS_CC); + RETURN_THROWS(); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool Imagick::adaptiveBlurImage(float radius, float sigma, int channel ) + Adds adaptive blur filter to image +*/ +PHP_METHOD(Imagick, adaptiveBlurImage) +{ + double radius, sigma; + php_imagick_object *intern; + MagickBooleanType status; + im_long channel = IM_DEFAULT_CHANNEL; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd|l", &radius, &sigma, &channel) == FAILURE) {
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_file.c
Added
@@ -0,0 +1,369 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_file.h" +#include "php_imagick_macros.h" +#include "php_imagick_defs.h" + +#if ZEND_MODULE_API_NO > 20060613 +# define IMAGICK_INIT_ERROR_HANDLING zend_error_handling error_handling +# define IMAGICK_SET_ERROR_HANDLING_THROW zend_replace_error_handling(EH_THROW, php_imagick_exception_class_entry, &error_handling TSRMLS_CC) +# define IMAGICK_RESTORE_ERROR_HANDLING zend_restore_error_handling(&error_handling TSRMLS_CC) +#else +# define IMAGICK_INIT_ERROR_HANDLING +# define IMAGICK_SET_ERROR_HANDLING_THROW php_set_error_handling(EH_THROW, php_imagick_exception_class_entry TSRMLS_CC) +# define IMAGICK_RESTORE_ERROR_HANDLING php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC) +#endif + +#ifndef S_ISDIR +# define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +static +zend_bool php_imagick_is_virtual_format(const char *format) +{ + int i, elements; + + const char *virtual_fmt = { + "CANVAS", + "CAPTION", + "CLIPBOARD", + "FRACTAL", + "GRADIENT", + "GRANITE", + "HALD", // Identity Hald CLUT Image Select levels like this: hald:8 for level 8. + "INLINE", // Base64-encoded inline image + "LABEL", + "LOGO", + "MAGICK", + "MAP", // Colormap intensities and indices Set -depth to set the sample size of the intensities; indices are 16-bit if colors > 256. + "MASK", // Image mask + "MATTE", + "NETSCAPE", + "NULL", + "PANGO", // Image caption + "PLASMA", + "PRINT", + "RADIAL-GRADIENT", + "RADIAL_GRADIENT", + "ROSE", + "SCAN", + "SCANX", + "TILE", // Tiled image + "UNIQUE", + "WIN", +#ifndef PHP_WIN32 + "X", +#endif + "XC", + }; + + elements = sizeof (virtual_fmt) / sizeof (virtual_fmt 0); + + for (i = 0; i < elements; i++) { + if (strcasecmp(format, virtual_fmti) == 0) { + return 1; + } + } + return 0; +} + +static +zend_bool php_imagick_is_url(const char *filename TSRMLS_DC) +{ + const char *path_for_open; + + if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) { + return 1; + } + return 0; +} + +zend_bool php_imagick_file_init(struct php_imagick_file_t *file, const char *filename, size_t filename_len TSRMLS_DC) +{ + char magick_pathMaxTextExtent, head_pathMaxTextExtent, tail_pathMaxTextExtent, bufferMaxTextExtent; + + if (!filename_len) { + return 0; + } + + /* Undefined for now */ + file->type = ImagickUndefinedType; + + if (filename_len >= MaxTextExtent) { + return 0; + } + + /* Take a copy of the original string */ + strlcpy(file->filename, filename, MaxTextExtent); + file->filename_len = filename_len; + + /* Break the path into pieces */ + memset(magick_path, 0, MaxTextExtent); + GetPathComponent(file->filename, MagickPath, magick_path); + + /* The path has a format identifier, check for url and virtual format */ + if (strlen(magick_path) > 0) { + /* Virtual format? */ + if (php_imagick_is_virtual_format(magick_path)) { + file->type = ImagickVirtualFormat; + file->absolute_path = estrdup(""); + return 1; + } + /* Is it an url? */ + else if (php_imagick_is_url(filename TSRMLS_CC)) { + file->type = ImagickUri; + file->absolute_path = estrdup(""); + return 1; + } + } + + /* This is a normal file path */ + file->type = ImagickFile; + + memset(head_path, 0, MaxTextExtent); + memset(tail_path, 0, MaxTextExtent); + + GetPathComponent(file->filename, HeadPath, head_path); + GetPathComponent(file->filename, TailPath, tail_path); + + (void) snprintf(buffer, MaxTextExtent, "%s/%s", head_path, tail_path); + + /* The full path to the file */ + file->absolute_path = expand_filepath(buffer, NULL TSRMLS_CC); + + /* Failed to resolve absolute path */ + if (!file->absolute_path) { + file->absolute_path = estrdup(""); + } + return 1; +} + +void php_imagick_file_deinit(struct php_imagick_file_t *file) +{ + if (file->absolute_path) { + efree(file->absolute_path); + file->absolute_path = NULL; + } +} + +static +int php_imagick_read_image_using_imagemagick(php_imagick_object *intern, struct php_imagick_file_t *file, ImagickOperationType type TSRMLS_DC) +{ + +#if PHP_VERSION_ID < 70000 +#if PHP_VERSION_ID >= 50600 +#ifdef ZTS + // This suppresses an 'unused parameter' warning. + (void)tsrm_ls; +#endif +#endif +#endif + + if (type == ImagickReadImage) { + if (MagickReadImage(intern->magick_wand, file->filename) == MagickFalse) { + +#if PHP_VERSION_ID >= 70000 + zend_stat_t st; +#else + struct stat st; +#endif + + /* Resolved to a filename. Check that it's not a dir */ + if (php_sys_stat(file->absolute_path, &st) == 0 && S_ISDIR(st.st_mode)) { + return IMAGICK_RW_PATH_IS_DIR; + } + return IMAGICK_RW_UNDERLYING_LIBRARY; + } + } else if (type == ImagickPingImage){ + if (MagickPingImage(intern->magick_wand, file->filename) == MagickFalse) { + return IMAGICK_RW_UNDERLYING_LIBRARY; + }
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagick_helpers.c
Added
@@ -0,0 +1,2039 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +MagickBooleanType php_imagick_progress_monitor(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *client_data) +{ + FILE *fp; + php_imagick_object *intern = (php_imagick_object *)client_data; + + if (!intern) { + return MagickFalse; + } + + if (!intern->progress_monitor_name) { + return MagickFalse; + } + + fp = fopen(intern->progress_monitor_name, "a+"); + + if (!fp) { + return MagickFalse; + } + + fprintf(fp, "text: %s, offset: %lld, span: %llu\n", text, offset, span); + fclose(fp); + return MagickTrue; +} + +void php_imagick_cleanup_progress_callback(php_imagick_callback* progress_callback TSRMLS_DC) { + + if (progress_callback) { + if (progress_callback->previous_callback) { + php_imagick_cleanup_progress_callback(progress_callback->previous_callback TSRMLS_CC); + efree(progress_callback->previous_callback); + } + +#if PHP_VERSION_ID >= 70000 + zval_ptr_dtor(&progress_callback->user_callback); +#else + zval_ptr_dtor(&progress_callback->user_callback); +#endif + } +} + +MagickBooleanType php_imagick_progress_monitor_callable(const char *text, const MagickOffsetType offset, const MagickSizeType span, void *userData) +{ + int error; + zend_fcall_info fci; + zend_fcall_info_cache fci_cache; + +#if PHP_VERSION_ID >= 70000 + zval zargs2; + zval retval; +#else + zval **zargs2; + zval *retval_ptr; +#endif + + //We can get the data both via the passed param and via + //IMAGICK_G(progress_callback) - this should be quicker + php_imagick_callback *callback = (php_imagick_callback*)userData; + + // This suppresses an 'unused parameter' warning. + // We could maybe use text. + (void)text; + +#if PHP_VERSION_ID >= 70000 && defined(ZTS) + if( NULL == tsrm_get_ls_cache() ) { + return MagickTrue; + } +#endif + +#if PHP_VERSION_ID < 70000 + TSRMLS_FETCH_FROM_CTX(callback->thread_ctx); +#endif + fci_cache = empty_fcall_info_cache; + + fci = empty_fcall_info; + fci.size = sizeof(fci); + +#if PHP_VERSION_ID < 70100 + fci.function_table = EG(function_table); +#endif +#if PHP_VERSION_ID >= 70000 + //fci.function_name = *callback->user_callback; + ZVAL_COPY_VALUE(&fci.function_name, &callback->user_callback); + fci.retval = &retval; +#else + retval_ptr = NULL; + fci.function_name = callback->user_callback; + fci.retval_ptr_ptr = &retval_ptr; +#endif + fci.param_count = 2; + fci.params = zargs; + +#if PHP_VERSION_ID >= 70000 + ZVAL_LONG(&zargs0, offset); + ZVAL_LONG(&zargs1, span); +#else + zargs0 = emalloc(sizeof(zval *)); + MAKE_STD_ZVAL(*zargs0); + ZVAL_LONG(*zargs0, offset); + + zargs1 = emalloc(sizeof(zval *)); + MAKE_STD_ZVAL(*zargs1); + ZVAL_LONG(*zargs1, span); +#endif + + error = zend_call_function(&fci, &fci_cache TSRMLS_CC); + + if (error == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback"); + //Abort processing as user callback is no longer callable + return MagickFalse; + } +#if PHP_VERSION_ID >= 70000 + if (Z_TYPE(retval) == IS_FALSE) { + //User returned false - tell Imagick to abort processing. + return MagickFalse; + } +#else + zval_ptr_dtor(zargs0); + zval_ptr_dtor(zargs1); + + if (retval_ptr) { + if (Z_TYPE_P(retval_ptr) == IS_BOOL) { + if (Z_LVAL_P(retval_ptr) == 0) { + //User returned false - tell Imagick to abort processing. + return MagickFalse; + } + } + } +#endif + + return MagickTrue; +} + +/* This is not universally safe to use, but is safe enough for values that will + be encountered for image dimensions. +*/ +static inline double im_round_helper(double value) { + if (value >= 0.0) { + // Prevent zero width/height images + if (value < 1) { + return 1; + } + return floor(value + 0.5); + } else { + return ceil(value - 0.5); + } +} + + +zend_bool php_imagick_thumbnail_dimensions(MagickWand *magick_wand, zend_bool bestfit, im_long desired_width, im_long desired_height, im_long *new_width, im_long *new_height, zend_bool legacy) +{ + im_long orig_width, orig_height; + + orig_width = MagickGetImageWidth(magick_wand); + orig_height = MagickGetImageHeight(magick_wand); + + if ((orig_width == desired_width) && (orig_height == desired_height)) { + *new_width = desired_width; + *new_height = desired_height; + return 1; + } + + if (bestfit) { + double ratio_x, ratio_y; + + if (desired_width <= 0 || desired_height <= 0) { + return 0; + } + + ratio_x = (double) desired_width / (double) orig_width; + ratio_y = (double) desired_height / (double) orig_height; + + //in the case of square images there should be no rounding error + if (ratio_x == ratio_y) {
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickdraw_class.c
Added
@@ -0,0 +1,3080 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion > 0x628 +/* {{{ proto bool ImagickDraw::resetvectorgraphics() + Resets the vector graphics +*/ +PHP_METHOD(ImagickDraw, resetVectorGraphics) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis()); + DrawResetVectorGraphics(internd->drawing_wand); + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x649 +/* {{{ proto bool ImagickDraw::getTextKerning() + Gets the text kerning +*/ +PHP_METHOD(ImagickDraw, getTextKerning) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextKerning(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextKerning(float kerning) + Sets the text kerning +*/ +PHP_METHOD(ImagickDraw, setTextKerning) +{ + php_imagickdraw_object *internd; + double kerning; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &kerning) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextKerning(internd->drawing_wand, kerning); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::getTextInterwordSpacing() + Gets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, getTextInterwordSpacing) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextInterwordSpacing(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextInterwordSpacing(float spacing) + Sets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, setTextInterwordSpacing) +{ + php_imagickdraw_object *internd; + double spacing; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextInterwordSpacing(internd->drawing_wand, spacing); + RETURN_TRUE; +} +/* }}} */ +#endif + +#if MagickLibVersion > 0x655 +/* {{{ proto bool ImagickDraw::getTextInterlineSpacing() + Gets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, getTextInterlineSpacing) +{ + php_imagickdraw_object *internd; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + RETURN_DOUBLE(DrawGetTextInterlineSpacing(internd->drawing_wand)); +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::setTextInterlineSpacing(float spacing) + Sets the text interword spacing +*/ +PHP_METHOD(ImagickDraw, setTextInterlineSpacing) +{ + php_imagickdraw_object *internd; + double spacing; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &spacing) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + DrawSetTextInterlineSpacing(internd->drawing_wand, spacing); + RETURN_TRUE; +} +/* }}} */ +#endif + +/* {{{ proto ImagickDraw ImagickDraw::__construct() + The ImagickDraw constructor +*/ +PHP_METHOD(ImagickDraw, __construct) +{ + /* Empty constructor for possible future uses */ + +#if PHP_VERSION_ID >= 70000 + // This suppresses an 'unused parameter' warning. + (void)execute_data; + (void)return_value; +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::circle(float ox, float oy, float px, float py) + Draws a circle on the image. +*/ +PHP_METHOD(ImagickDraw, circle) +{ + double ox, oy, px, py; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &ox, &oy, &px, &py) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());; + + DrawCircle(internd->drawing_wand, ox, oy, px, py); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickDraw::rectangle(float x1, float y1, float x2, float y2) + Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings. +*/ +PHP_METHOD(ImagickDraw, rectangle) +{ + double x1, y1, x2, y2; + php_imagickdraw_object *internd; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &x1, &y1, &x2, &y2) == FAILURE) { + RETURN_THROWS(); + } + + internd = Z_IMAGICKDRAW_P(getThis());;
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickkernel_class.c
Added
@@ -0,0 +1,856 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Dan Ackroyd <danack@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#ifdef IMAGICK_WITH_KERNEL + +#if MagickLibVersion < 0x691 +// These function defines are required currently as the functions are +// currently not available in the public ImageMagick header files +// This is being fixed for the next version of ImageMagick. +Image + *MorphologyApply(const Image *,const ChannelType,const MorphologyMethod, + const ssize_t,const KernelInfo *,const CompositeOperator,const double, + ExceptionInfo *); + +void + ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), + UnityAddKernelInfo(KernelInfo *,const double), + ZeroKernelNans(KernelInfo *); +#endif + + +static void php_imagickkernelvalues_to_zval(zval *zv, KernelInfo *kernel_info) { + int count; + double value; + unsigned int x, y; +#if PHP_VERSION_ID >= 70000 + zval row; +#else + zval *row; +#endif + + zval *p_row; + + count = 0; + + for (y=0; y<kernel_info->height ; y++) { +#if PHP_VERSION_ID >= 70000 + p_row = &row; +#else + MAKE_STD_ZVAL(row); + p_row = row; +#endif + + array_init(p_row); + for (x=0; x<kernel_info->width ; x++) { + value = kernel_info->valuescount; + count++; + + //nan is not equal to itself + if (value != value) { + //this will be broken by some compilers - need to investigate more... + add_next_index_bool(p_row, 0); + } + else { + add_next_index_double(p_row, value); + } + } + + add_next_index_zval(zv, p_row); + } +} + + +#if PHP_VERSION_ID >= 80000 +HashTable* php_imagickkernel_get_debug_info(zend_object *obj, int *is_temp TSRMLS_DC) /* {{{ */ +#else +HashTable* php_imagickkernel_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +#endif +{ + php_imagickkernel_object *internp; + HashTable *debug_info; + KernelInfo *kernel_info; +#if PHP_VERSION_ID >= 70000 + zval matrix; +#else + zval *matrix; +#endif + + *is_temp = 1; //var_dump will destroy the hashtable + +#if PHP_VERSION_ID >= 80000 + internp = php_imagickkernel_fetch_object(obj); +#else + internp = Z_IMAGICKKERNEL_P(obj); +#endif + kernel_info = internp->kernel_info; + + ALLOC_HASHTABLE(debug_info); + ZEND_INIT_SYMTABLE_EX(debug_info, 1, 0); + + while (kernel_info != NULL) { +#if PHP_VERSION_ID >= 70000 + array_init(&matrix); + php_imagickkernelvalues_to_zval(&matrix, kernel_info); + zend_hash_next_index_insert(debug_info, &matrix); +#else + MAKE_STD_ZVAL(matrix); + array_init(matrix); + php_imagickkernelvalues_to_zval(matrix, kernel_info); + zend_hash_next_index_insert(debug_info, &matrix, sizeof(zval *), NULL); +#endif + kernel_info = kernel_info->next; + } + + return debug_info; +} + + +static void im_CalcKernelMetaData(KernelInfo *kernel) { + size_t i; + + kernel->minimum = kernel->maximum = 0.0; + kernel->negative_range = kernel->positive_range = 0.0; + + for (i=0; i < (kernel->width*kernel->height); i++) { + if (fabs(kernel->valuesi) < MagickEpsilon) { + kernel->valuesi = 0.0; + } + if (kernel->valuesi < 0) { + kernel->negative_range += kernel->valuesi; + } + else { + kernel->positive_range += kernel->valuesi; + } + if (kernel->valuesi < kernel->minimum) { + kernel->minimum = kernel->valuesi; + } + + if (kernel->valuesi > kernel->maximum) { + kernel->maximum = kernel->valuesi; + } + } +} + + +#if MagickLibVersion > 0x661 +static KernelInfo *imagick_createKernel(KernelValueType *values, size_t width, size_t height, size_t origin_x, size_t origin_y) +{ + KernelInfo *kernel_info; + +#if MagickLibVersion >= 0x700 + unsigned int i; + ExceptionInfo *_exception_info = (ExceptionInfo *) NULL; + //TODO - inspect exception info + kernel_info=AcquireKernelInfo(NULL, _exception_info); +#else + kernel_info=AcquireKernelInfo(NULL); +#endif + if (kernel_info == (KernelInfo *) NULL) { + return NULL; + } + + kernel_info->width = width; + kernel_info->height = height; + + kernel_info->x = origin_x; + kernel_info->y = origin_y; + + //Need to free old values? + if (kernel_info->values != NULL) { + RelinquishAlignedMemory(kernel_info->values); + } + +#if MagickLibVersion >= 0x700 + kernel_info->values = (MagickRealType *)AcquireAlignedMemory(width*height, sizeof(MagickRealType)); + + for (i=0; i<width*height;i++) { + kernel_info->valuesi = (MagickRealType)valuesi; + } + // The values are not going to be used so free them + RelinquishAlignedMemory(values); + +#else + // For IM 6, the values get used + kernel_info->values = values; +#endif + + im_CalcKernelMetaData(kernel_info); + + return kernel_info; +}
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickpixel_class.c
Added
@@ -0,0 +1,798 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion > 0x628 +/* {{{ proto array ImagickPixel::getHSL() + Returns the normalized HSL color of the pixel wand in an array with the keys "hue", "saturation", and "luminosity". +*/ +PHP_METHOD(ImagickPixel, getHSL) +{ + php_imagickpixel_object *internp; + double hue, saturation, luminosity; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelGetHSL(internp->pixel_wand, &hue, &saturation, &luminosity); + + array_init(return_value); + add_assoc_double(return_value, "hue", hue); + add_assoc_double(return_value, "saturation", saturation); + add_assoc_double(return_value, "luminosity", luminosity); +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setHSL(float hue, float saturation, float luminosity) + Sets the normalized HSL color of the pixel wand. +*/ +PHP_METHOD(ImagickPixel, setHSL) +{ + php_imagickpixel_object *internp; + double hue, saturation, luminosity; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &hue, &saturation, &luminosity) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + PixelSetHSL(internp->pixel_wand, hue, saturation, luminosity); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto Quantum ImagickPixel::getColorValueQuantum(int color) + Gets the quantum value of a color in the ImagickPixel. Quantum is a float if ImageMagick was compiled with HDRI + otherwise an integer. +*/ +PHP_METHOD(ImagickPixel, getColorValueQuantum) +{ + php_imagickpixel_object *internp; + im_long color; + Quantum color_value; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &color) == FAILURE) { + RETURN_THROWS(); + } + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + switch (color) { + + case PHP_IMAGICK_COLOR_BLACK: + color_value = PixelGetBlackQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_BLUE: + color_value = PixelGetBlueQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_CYAN: + color_value = PixelGetCyanQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_GREEN: + color_value = PixelGetGreenQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_RED: + color_value = PixelGetRedQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + color_value = PixelGetYellowQuantum(internp->pixel_wand); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + color_value = PixelGetMagentaQuantum(internp->pixel_wand); + break; + +#if MagickLibVersion < 0x700 + case PHP_IMAGICK_COLOR_OPACITY: + color_value = PixelGetOpacityQuantum(internp->pixel_wand); + break; +#endif + + case PHP_IMAGICK_COLOR_ALPHA: + color_value = PixelGetAlphaQuantum(internp->pixel_wand); + break; + + default: + php_imagick_throw_exception (IMAGICKPIXEL_CLASS, "Unknown color type" TSRMLS_CC); + RETURN_THROWS(); + break; + } + +#if MAGICKCORE_HDRI_ENABLE + RETVAL_DOUBLE(color_value); +#else + RETVAL_LONG(color_value); +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixel::setColorValueQuantum(int color, float value) + Sets the quantum color of the ImagickPixel. +*/ +PHP_METHOD(ImagickPixel, setColorValueQuantum) +{ + php_imagickpixel_object *internp; + im_long color; + +#if MAGICKCORE_HDRI_ENABLE + double color_value; + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &color, &color_value) == FAILURE) { + RETURN_THROWS(); + } +#else + im_long color_value; + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &color, &color_value) == FAILURE) { + RETURN_THROWS(); + } +#endif + + internp = Z_IMAGICKPIXEL_P(getThis()); + IMAGICK_PIXEL_NOT_EMPTY(internp); + + switch (color) { + + case PHP_IMAGICK_COLOR_BLACK: + PixelSetBlackQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_BLUE: + PixelSetBlueQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_CYAN: + PixelSetCyanQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_GREEN: + PixelSetGreenQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_RED: + PixelSetRedQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_YELLOW: + PixelSetYellowQuantum(internp->pixel_wand, color_value); + break; + + case PHP_IMAGICK_COLOR_MAGENTA: + PixelSetMagentaQuantum(internp->pixel_wand, color_value); + break; + +#if MagickLibVersion < 0x700
View file
imagick-3.8.0.tgz/imagick-3.8.0/imagickpixeliterator_class.c
Added
@@ -0,0 +1,679 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" + +#if MagickLibVersion <= 0x628 +static +long s_count_pixeliterator_rows(php_imagickpixeliterator_object *internpix) +{ + long rows = 0, tmp; + PixelWand **row; + PixelResetIterator(internpix->pixel_iterator); + + while ((row = PixelGetNextIteratorRow(internpix->pixel_iterator, &tmp)) != NULL) + rows++; + + return rows; +} +#endif + +void php_imagick_pixel_iterator_new (PixelIterator *pixel_it, zval *return_value TSRMLS_DC) +{ + php_imagickpixeliterator_object *internpix; + + object_init_ex(return_value, php_imagickpixeliterator_sc_entry); + internpix = Z_IMAGICKPIXELITERATOR_P(return_value); + + internpix->pixel_iterator = pixel_it; + internpix->initialized = 1; + +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif +} + +/* {{{ proto ImagickPixelIterator ImagickPixelIterator::__construct(Imagick source) + The ImagickPixelIterator constructor +*/ +PHP_METHOD(ImagickPixelIterator, __construct) +{ + zval *magick_object; + php_imagickpixeliterator_object *internpix; + php_imagick_object *intern; + + /* Parse parameters given to function */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|llll", &magick_object, php_imagick_sc_entry) == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + intern = Z_IMAGICK_P(magick_object); + + if (!intern->magick_wand) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Invalid Imagick object passed" TSRMLS_CC); + RETURN_THROWS(); + } + + IMAGICK_NOT_EMPTY(intern); + + internpix->pixel_iterator = NewPixelIterator(intern->magick_wand); + + if (!internpix->pixel_iterator) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "Can not allocate ImagickPixelIterator" TSRMLS_CC); + RETURN_THROWS(); + } + +#if MagickLibVersion <= 0x628 + internpix->rows = s_count_pixeliterator_rows (internpix); +#endif + + internpix->initialized = 1; + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto void ImagickPixelIterator::rewind() + Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. +*/ +PHP_METHOD(ImagickPixelIterator, rewind) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + (void)return_value; // fix -Werror=unused-parameter + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelResetIterator(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::resetIterator() + Resets the pixel iterator. Use it in conjunction with PixelGetNextIteratorRow() to iterate over all the pixels in a pixel container. +*/ +PHP_METHOD(ImagickPixelIterator, resetIterator) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelResetIterator(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::syncIterator() + Syncs the pixel iterator. +*/ +PHP_METHOD(ImagickPixelIterator, syncIterator) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelSyncIterator(internpix->pixel_iterator); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::setIteratorFirstRow() + Sets the pixel iterator to the first pixel row. +*/ +PHP_METHOD(ImagickPixelIterator, setIteratorFirstRow) +{ + php_imagickpixeliterator_object *internpix; + + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); + } + + internpix = Z_IMAGICKPIXELITERATOR_P(getThis()); + + if (!internpix->initialized) { + php_imagick_throw_exception (IMAGICKPIXELITERATOR_CLASS, "ImagickPixelIterator is not initialized correctly" TSRMLS_CC); + RETURN_THROWS(); + } + + PixelSetFirstIteratorRow(internpix->pixel_iterator); +#if MagickLibVersion <= 0x628 + internpix->iterator_position = 0; +#endif + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto bool ImagickPixelIterator::setIteratorLastRow() + Sets the pixel iterator to the last pixel row.
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagemagick_version_defs.h
Added
@@ -0,0 +1,232 @@ + +#ifndef PHP_IMAGEMAGICK_VERSION_DEFS_H +# define PHP_IMAGEMAGICK_VERSION_DEFS_H + +// Q) Why are the defines done in this file? +// +// A) Checking whether an ImageMagick function is available _and_ usable is +// annoyingly difficult. It's pretty common for new functions to be introduced +// in patch releases, (e.g. 6.5.4-8) rather than in minor releases (6.5.5-0). +// +// Additionally, the api for new functions often changes quite rapidly in the +// first few versions it is available in, which means we can't just check for +// the presence of the symbol +// +// Because of those two things, the sanest thing to do is to support features +// based on the minimum minor version from which they are continually +// available and stable. +// +// Any mistake in which version is required for a feature can be fixed in a +// single place, rather than having to have duplicated info elsewhere. + + +#if MagickLibVersion >= 0x700 + #if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 + #endif +#elif MagickLibVersion >= 0x631 + #define IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD 1 +#endif + + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR 1 +#endif + + +// Although there is some 'cannyEdgeImage' code in ImageMagick 6, +// there is no 'MagickCannyEdgeImage' exported function in the API. +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_CANNYEDGEIMAGE 1 +#endif + + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_SETSEED 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_WAVELETDENOISEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_MEANSHIFTIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_KMEANSIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_RANGETHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_AUTOTHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_BILATERALBLURIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_CLAHEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_CHANNELFXIMAGE 1 +#endif + +#if MagickLibVersion >= 0x710 + #define IM_HAVE_IMAGICK_COLORTHRESHOLDIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_COMPLEXIMAGES 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_INTERPOLATIVERESIZEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_LEVELIMAGECOLORS 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_LEVELIZEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_ORDEREDDITHERIMAGE 1 +#endif + +#if MagickLibVersion >= 0x70B + #define IM_HAVE_IMAGICK_WHITEBALANCEIMAGE 1 +#endif + +#if MagickLibVersion >= 0x702 + #define IM_HAVE_IMAGICK_ADD_NOISE_WITH_ATTENUATE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_DELETE_OPTION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_BACKGROUND_COLOR 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_ARTIFACTS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_DISTORTIONS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_KURTOSIS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_MEAN 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_IMAGE_RANGE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_INTERPOLATE_METHOD 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_OPTIONS 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_ORIENTATION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_RESOLUTION 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_GET_TYPE 1 +#endif + +#if MagickLibVersion >= 0x709 + #define IM_HAVE_IMAGICK_POLYNOMIAL_IMAGE 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_DEPTH 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_EXTRACT 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_INTERPOLATE_METHOD 1 +#endif + +#if MagickLibVersion >= 0x701 + #define IM_HAVE_IMAGICK_SET_ORIENTATION 1 +#endif + +#if MagickLibVersion >= 0x70A + // Technically, this may be available earlier, but the behaviour around + // default mask changed. + #define IM_HAVE_IMAGICK_GETSETIMAGEMASK 1 + +// ImageMagick forget to export the header until about 7.0.11-14... +WandExport MagickBooleanType MagickSetImageMask( + MagickWand *wand, const PixelMask type, const MagickWand *clip_mask +); + +#endif + +// The above is sub-optimal as it's hard to read. It'd be better to do +// something like the below: + +//#define MAGICK_LIB_RANGE(NAME, IM6_VERSION, IM7_VERSION) slash +//#if MagickLibVersion >= 0x700 slash +// #if MagickLibVersion >= IM7_VERSION slash +// #define IM_HAVE_##NAME 1 slash +// #endif slash
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick.h
Added
@@ -0,0 +1,51 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ +#ifndef PHP_IMAGICK_H +/* Prevent double inclusion */ +#define PHP_IMAGICK_H + +/* Define Extension Properties */ +#define PHP_IMAGICK_EXTNAME "imagick" +// The version is deliberately left as 'PACKAGE_VERSION' in source code. +// It is only replaced with the actual version number that packaged through pecl.php.net +#define PHP_IMAGICK_VERSION "3.8.0" +#define PHP_IMAGICK_EXTNUM 30800 + +/* Import configure options when building + outside of the PHP source tree */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef ZTS +# include "TSRM.h" +#endif + +/* Include PHP Standard Headers */ +#include "php.h" + +/* Define the entry point symbol + * ZE will use when loading this module + */ +extern zend_module_entry imagick_module_entry; +#define phpext_imagick_ptr &imagick_module_entry + +#endif /* PHP_IMAGICK_H */ +
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_defs.h
Added
@@ -0,0 +1,1258 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ +#ifndef PHP_IMAGICK_DEFS_H /* PHP_IMAGICK_DEFS_H */ +# define PHP_IMAGICK_DEFS_H + +/* Include magic wand header */ +#if defined (IM_MAGICKWAND_HEADER_STYLE_SEVEN) +# include <MagickWand/MagickWand.h> +#elif defined (IM_MAGICKWAND_HEADER_STYLE_OLD) +# include <wand/magick-wand.h> +#else +# include <wand/MagickWand.h> +#endif + +#include "php_imagemagick_version_defs.h" + +#if MagickLibVersion >= 0x700 +#include "shim_im6_to_im7.h" +#endif + +/* Some extra headers */ +#include "Zend/zend_exceptions.h" +#include "Zend/zend_interfaces.h" +#include "ext/standard/php_string.h" +#include "ext/standard/info.h" +#include "ext/standard/php_filestat.h" +#include "php_ini.h" +#include "Zend/zend.h" + +#if PHP_VERSION_ID >= 80000 + #define HAVE_LOCALE_H + #define TSRMLS_C + #define TSRMLS_CC + #define TSRMLS_D + #define TSRMLS_DC + #define TSRMLS_FETCH() + #define TSRMLS_SET_CTX(ctx) +#endif + +/* Include locale header */ +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + +#if MagickLibVersion >= 0x680 + #define IMAGICK_WITH_KERNEL +#endif + + + +#if MagickLibVersion >= 0x700 +#if !defined(MaxTextExtent) +# define MaxTextExtent 4096 /* always >= 4096 */ +#endif + +#endif + + +#if PHP_VERSION_ID >= 70000 + #define im_long zend_long +#else + #define im_long long +#endif + +#if PHP_VERSION_ID >= 70200 + #define im_ce_countable zend_ce_countable +#else + #define im_ce_countable spl_ce_Countable +#endif + +typedef struct _php_imagick_callback { + void ***thread_ctx; +#if PHP_VERSION_ID >= 70000 + zval user_callback; +#else + zval *user_callback; +#endif + struct _php_imagick_callback *previous_callback; +} php_imagick_callback; + +/* Globals, needed for the ini settings */ +ZEND_BEGIN_MODULE_GLOBALS(imagick) + zend_bool locale_fix; + zend_bool progress_monitor; + zend_bool skip_version_check; + + zend_bool set_single_thread; + zend_bool allow_zero_dimension_images; + im_long shutdown_sleep_count; + + php_imagick_callback *progress_callback; +#ifdef PHP_IMAGICK_ZEND_MM + MagickWand *keep_alive; +#endif +ZEND_END_MODULE_GLOBALS(imagick) + +#ifdef ZTS +# define IMAGICK_G(v) TSRMG(imagick_globals_id, zend_imagick_globals *, v) +#else +# define IMAGICK_G(v) (imagick_globals.v) +#endif + +ZEND_EXTERN_MODULE_GLOBALS(imagick) + +#ifdef HAVE_LOCALE_H +# if defined(PHP_WIN32) +# define IMAGICK_LC_NUMERIC_LOCALE "English" +# else +# define IMAGICK_LC_NUMERIC_LOCALE "C" +# endif +#endif + +#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3 +#define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") +#endif + + +/* Class names */ +#define PHP_IMAGICK_SC_NAME "Imagick" +#define PHP_IMAGICK_EXCEPTION_SC_NAME "ImagickException" + +#define PHP_IMAGICKDRAW_SC_NAME "ImagickDraw" +#define PHP_IMAGICKDRAW_EXCEPTION_SC_NAME "ImagickDrawException" + +#define PHP_IMAGICKPIXEL_SC_NAME "ImagickPixel" +#define PHP_IMAGICKPIXEL_EXCEPTION_SC_NAME "ImagickPixelException" + +#define PHP_IMAGICKPIXELITERATOR_SC_NAME "ImagickPixelIterator" +#define PHP_IMAGICKPIXELITERATOR_EXCEPTION_SC_NAME "ImagickPixelIteratorException" + +#ifdef IMAGICK_WITH_KERNEL +#define PHP_IMAGICKKERNEL_SC_NAME "ImagickKernel" +#define PHP_IMAGICKKERNEL_EXCEPTION_SC_NAME "ImagickKernelException" +#endif + + +#if PHP_VERSION_ID >= 70000 + +/* Structure for Imagick object. */ +typedef struct _php_imagick_object { + MagickWand *magick_wand; + char *progress_monitor_name; + zend_bool next_out_of_bound; + zend_object zo; +} php_imagick_object; + +#else + +/* Structure for Imagick object. */ +typedef struct _php_imagick_object { + zend_object zo; + MagickWand *magick_wand; + char *progress_monitor_name; + zend_bool next_out_of_bound; +} php_imagick_object; + +#endif + + +#if PHP_VERSION_ID >= 70000 + +/* Structure for ImagickDraw object. */ +typedef struct _php_imagickdraw_object { + DrawingWand *drawing_wand; + zend_object zo; +} php_imagickdraw_object; + + +#else + + +/* Structure for ImagickDraw object. */ +typedef struct _php_imagickdraw_object { + zend_object zo; + DrawingWand *drawing_wand; +} php_imagickdraw_object; + + +#endif + +#if PHP_VERSION_ID >= 70000 +
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_file.h
Changed
(renamed from imagick-3.7.0/php_imagick_file.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_helpers.h
Changed
(renamed from imagick-3.7.0/php_imagick_helpers.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_macros.h
Added
@@ -0,0 +1,79 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 / Imagick | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2013 Mikko Koppanen, Scott MacVicar | + | ImageMagick (c) ImageMagick Studio LLC | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Mikko Kopppanen <mkoppanen@php.net> | + | Scott MacVicar <scottmac@php.net> | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IMAGICK_MACROS_H +# define PHP_IMAGICK_MACROS_H + +#define EXTRACT_BUILD_NUMBER(str) ({ \ + int build = 0; \ + const char *s = str; \ + while (*s && !isdigit(*s)) s++; \ + if (*s) build = atoi(s); \ + build; \ +}) + +#define MAGICK_LIB_VERSION_MAJOR ((MagickLibVersion >> 8) & 0xFF) +#define MAGICK_LIB_VERSION_MINOR ((MagickLibVersion >> 4) & 0xF) +#define MAGICK_LIB_VERSION_PATCH (MagickLibVersion & 0xF) +#define MAGICK_LIB_VERSION_BUILD EXTRACT_BUILD_NUMBER(MagickLibAddendum) + +#define MAGICK_LIB_VERSION_GTE(major, minor, patch, build) \ + ((VERSION_MAJOR > (major)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR > (minor)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR == (minor) && VERSION_PATCH > (patch)) || \ + (VERSION_MAJOR == (major) && VERSION_MINOR == (minor) && VERSION_PATCH == (patch) && VERSION_BUILD >= (build))) + +#define IMAGICK_FREE_MAGICK_MEMORY(value) \ + do { \ + if (value) { \ + MagickRelinquishMemory(value); \ + value = NULL; \ + } \ + } while (0) + +#if !defined(E_DEPRECATED) +# define E_DEPRECATED E_STRICT +#endif + +#define IMAGICK_METHOD_DEPRECATED(class_name, method_name) \ + php_error(E_DEPRECATED, "%s::%s method is deprecated and it's use should be avoided", class_name, method_name); + +#define IMAGICK_METHOD_DEPRECATED_USE_INSTEAD(class_name, method_name, new_class, new_method) \ + php_error(E_DEPRECATED, "%s::%s is deprecated. %s::%s should be used instead", class_name, method_name, new_class, new_method); + + +#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_THROWS(); \ + } + +#define IMAGICK_NOT_EMPTY(wand) \ + if (php_imagick_ensure_not_empty(wand->magick_wand) == 0) { \ + RETURN_THROWS(); \ + } + +#define IMAGICK_PIXEL_NOT_EMPTY(pixel) \ + if (php_imagickpixel_ensure_not_null(pixel->pixel_wand) == 0) { \ + RETURN_THROWS(); \ + } + + +#endif /* PHP_IMAGICK_MACROS_H */
View file
imagick-3.8.0.tgz/imagick-3.8.0/php_imagick_shared.h
Changed
(renamed from imagick-3.7.0/php_imagick_shared.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/regen_arginfo.sh
Changed
(renamed from imagick-3.7.0/regen_arginfo.sh)
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_im6_to_im7.c
Added
@@ -0,0 +1,895 @@ + +/* + +----------------------------------------------------------------------+ + | Imagick | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ +*/ + +#include "php_imagick.h" +#include "php_imagick_defs.h" +#include "php_imagick_macros.h" +#include "php_imagick_helpers.h" +#include "php_imagick_file.h" + + +#if MagickLibVersion >= 0x700 + + +// Functions that have been replaced by channel aware versions +MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,const ChannelType channel,const double radius, const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAdaptiveBlurImage(wand, radius, sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand, const ChannelType channel, const double radius, const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAdaptiveSharpenImage(wand, radius, sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAddNoiseImageChannel(MagickWand *wand,const ChannelType channel,const NoiseType noise_type) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + //TODO - what is the value meant to be? + status = MagickAddNoiseImage(wand, noise_type, 1.0); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +// This is not actually an ImageMagick function, but the name is likely to +// avoid any symbol clash for the foreseeable. +MagickBooleanType MagickAddNoiseImageChannelWithAttenuate(MagickWand *wand,const ChannelType channel,const NoiseType noise_type, double attenuate) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAddNoiseImage(wand, noise_type, attenuate); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + + +MagickBooleanType MagickAutoGammaImageChannel(MagickWand *wand, const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAutoGammaImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand, + const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickAutoLevelImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickBlurImageChannel(MagickWand *wand, + const ChannelType channel,const double radius,const double sigma) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickBlurImage(wand, radius,sigma); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,const ChannelType channel,const double brightness, const double contrast) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickBrightnessContrastImage(wand, brightness, contrast); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickClampImageChannel(MagickWand *wand, const ChannelType channel) { + MagickBooleanType status; + ChannelType previous_channel_mask; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + status = MagickClampImage(wand); + + if (channel != UndefinedChannel) { + (void) MagickSetImageChannelMask(wand, previous_channel_mask); + } + + return status; +} + +MagickBooleanType MagickClutImageChannel( + MagickWand *wand, + const ChannelType channel, + const MagickWand *clut_wand +) { + MagickBooleanType status; + ChannelType previous_channel_mask; + PixelInterpolateMethod pixelInterpolateMethod; + + if (channel != UndefinedChannel) { + previous_channel_mask = MagickSetImageChannelMask(wand, channel); + } + + pixelInterpolateMethod = MagickGetInterpolateMethod(wand);
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_im6_to_im7.h
Changed
(renamed from imagick-3.7.0/shim_im6_to_im7.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/shim_php7_to_php8.h
Changed
(renamed from imagick-3.7.0/shim_php7_to_php8.h)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/001_imagick_readimage.phpt
Changed
(renamed from imagick-3.7.0/tests/001_imagick_readimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/002_thumbnail.phpt
Changed
(renamed from imagick-3.7.0/tests/002_thumbnail.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/003_cast_color_opacity.phpt
Changed
(renamed from imagick-3.7.0/tests/003_cast_color_opacity.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/004_clone.phpt
Changed
(renamed from imagick-3.7.0/tests/004_clone.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/005_bestfit.phpt
Changed
(renamed from imagick-3.7.0/tests/005_bestfit.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/006_cropthumbnail.phpt
Changed
(renamed from imagick-3.7.0/tests/006_cropthumbnail.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/007_thumbnail_fill.phpt
Changed
(renamed from imagick-3.7.0/tests/007_thumbnail_fill.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/008_newpseudoimage.phpt
Changed
(renamed from imagick-3.7.0/tests/008_newpseudoimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/009_properties.phpt
Changed
(renamed from imagick-3.7.0/tests/009_properties.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/010_importimagepixels.phpt
Changed
(renamed from imagick-3.7.0/tests/010_importimagepixels.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/011_polygon.phpt
Changed
(renamed from imagick-3.7.0/tests/011_polygon.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/012-clone-separation.phpt
Changed
(renamed from imagick-3.7.0/tests/012-clone-separation.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle-file-stream.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Imagick::readImageFile, file stream test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--FILE-- +<?php + +$file = dirname(__FILE__) . '/__tmp_rose.jpg'; +$handle = fopen($file, 'w+'); + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImageFile($handle); + +$imagick->clear(); + +rewind($handle); + +$imagick->readImageFile($handle); + +echo "Width: " . $imagick->getImageWidth() . "\n"; +echo "Height: " . $imagick->getImageHeight() . "\n"; + +@unlink($file); + +echo 'success'; + +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); +?> +--EXPECT-- +Width: 70 +Height: 46 +success
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle-memory-stream.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Imagick::readImageFile, in-memory stream test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--XFAIL-- +This test was recently added (July 2024), and appears to be failing on multiple +versions of PHP. It should be fixed, but doesn't need to hold up a release. +--FILE-- +<?php + +$handle = fopen('php://memory', 'w+'); + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImageFile($handle); + +$imagick->clear(); + +rewind($handle); + +$imagick->readImageFile($handle); + +echo "Width: " . $imagick->getImageWidth() . "\n"; +echo "Height: " . $imagick->getImageHeight() . "\n"; + +echo 'success'; + +?> +--EXPECT-- +Width: 70 +Height: 46 +success
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/013-read-filehandle.phpt
Added
@@ -0,0 +1,32 @@ +--TEST-- +Imagick::readImageFile test +--SKIPIF-- +<?php + require_once(dirname(__FILE__) . '/skipif.inc'); + checkFormatPresent('jpg'); +?> +--FILE-- +<?php + +$file = dirname(__FILE__) . '/__tmp_rose.jpg'; + +$imagick = new Imagick('magick:rose'); +$imagick->setImageFormat('jpg'); +$imagick->writeImage($file); + +$imagick->clear(); + +$handle = fopen($file, 'rb'); +$imagick->readImageFile($handle); + +@unlink($file); + +echo 'success'; + +?> +--CLEAN-- +<?php +@unlink(dirname(__FILE__) . '/__tmp_rose.jpg'); +?> +--EXPECT-- +success \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/014-setresourcelimit.phpt
Added
@@ -0,0 +1,78 @@ +--TEST-- +Imagick::setResourceLimit test +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x692; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + + +$k = 1024; +$m = $k * $k; + +// These tests are flaky as the values ImageMagick will accept +// are limited by the policy.xml of the system. +// Also, it appears that some versions of ImageMagick will +// reject overly large values. e.g. setting RESOURCETYPE_WIDTH +// to a billion fails. Which is not totally unreasonable. + +$tests = array( + Imagick::RESOURCETYPE_AREA => 100000000, + + // Set maximum amount of disk space in bytes permitted for use by the pixel cache. When this limit is exceeded, the pixel cache is not be created and an error message is returned. + Imagick::RESOURCETYPE_DISK => 100, + + //Set maximum number of open pixel cache files. When this limit is exceeded, any subsequent pixels cached to disk are closed and reopened on demand. This behavior permits a large number of images to be accessed simultaneously on disk, but with a speed penalty due to repeated open/close calls. + Imagick::RESOURCETYPE_FILE => 100, + + // Set maximum amount of memory map in bytes to allocate for the pixel cache. When this limit is exceeded, the image pixels are cached to disk + Imagick::RESOURCETYPE_MAP => 123 * $m, + + // Set maximum amount of memory in bytes to allocate for the pixel cache from the heap. When this limit is exceeded, the image pixels are cached to memory-mapped disk + Imagick::RESOURCETYPE_MEMORY => 234 * $m, +); + +if (defined('Imagick::RESOURCETYPE_TIME')) { + $testsImagick::RESOURCETYPE_TIME = 30; +} + +if (defined('Imagick::RESOURCETYPE_THROTTLE')) { + $testsImagick::RESOURCETYPE_THROTTLE = 1; +} +if (defined('Imagick::RESOURCETYPE_THREAD')) { + $testsImagick::RESOURCETYPE_THREAD = 1; +} +if (defined('Imagick::RESOURCETYPE_WIDTH')) { + $testsImagick::RESOURCETYPE_WIDTH = 15 * $k; +} +if (defined('Imagick::RESOURCETYPE_HEIGHT')) { + $testsImagick::RESOURCETYPE_HEIGHT = 15 * $k; +} + +$reflection_class = new ReflectionClass(Imagick::class); +$constants = $reflection_class->getConstants(); +$resource_constants = ; +foreach ($constants as $name => $value) { + if (strpos($name, "RESOURCETYPE") === 0) { + $resource_constants$value = $name; + } +} + + +foreach ($tests as $resourceType => $value) { + Imagick::setResourceLimit($resourceType, $value); + $actualValue = Imagick::getResourceLimit($resourceType); + + if ($actualValue != $value) { + $resourceTypeString = $resource_constants$resourceType; + echo "Error testing $resourceTypeString, value returned $actualValue is not $value \n"; + } +} + +echo 'success'; + +?> +--EXPECTF-- +success \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/015-imagickdrawsetresolution.phpt
Changed
(renamed from imagick-3.7.0/tests/015-imagickdrawsetresolution.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/016-static-methods.phpt
Changed
(renamed from imagick-3.7.0/tests/016-static-methods.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/017-clear-destroy.phpt
Changed
(renamed from imagick-3.7.0/tests/017-clear-destroy.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/018-clone-length.phpt
Changed
(renamed from imagick-3.7.0/tests/018-clone-length.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/019-readimages.phpt
Changed
(renamed from imagick-3.7.0/tests/019-readimages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/020-pixeliterator.phpt
Changed
(renamed from imagick-3.7.0/tests/020-pixeliterator.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/021-countable.phpt
Changed
(renamed from imagick-3.7.0/tests/021-countable.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/022-writeimagefileformat.phpt
Changed
(renamed from imagick-3.7.0/tests/022-writeimagefileformat.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/024-ispixelsimilar.phpt
Changed
(renamed from imagick-3.7.0/tests/024-ispixelsimilar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/025-function-image.phpt
Changed
(renamed from imagick-3.7.0/tests/025-function-image.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/025-get-color.phpt
Changed
(renamed from imagick-3.7.0/tests/025-get-color.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/026_phpinfo.phpt
Changed
(renamed from imagick-3.7.0/tests/026_phpinfo.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/027_Imagick_adaptiveResizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/027_Imagick_adaptiveResizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/028_Imagick_adaptiveSharpenImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/028_Imagick_adaptiveSharpenImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/029_Imagick_adaptiveBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/029_Imagick_adaptiveBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/030_Imagick_adaptiveThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/030_Imagick_adaptiveThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/031_Imagick_affineTransformImage_basic.phpt
Added
@@ -0,0 +1,146 @@ +--TEST-- +Test Imagick, affineTransformImage +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +if (PHP_OS_FAMILY == 'Windows') die('skip dither is apparently borken on Windows https://github.com/Imagick/imagick/issues/590'); +?> +--XFAIL-- +I don't understand what values are returned in which elements of getImageChannelStatistics +--FILE-- +<?php + + +function checkAllStatsAreValue($channelStatistics, $value) { + + if ($channelStatisticsImagick::CHANNEL_RED'mean' != $value) { + echo "Channel red is wrong " . $channelStatisticsImagick::CHANNEL_RED'mean' . " vs " . $value. "\n"; + } + if ($channelStatisticsImagick::CHANNEL_GREEN'mean' != $value) { + echo "Channel green is wrong " . $channelStatisticsImagick::CHANNEL_GREEN'mean' . " vs " . $value. "\n"; + } + if ($channelStatisticsImagick::CHANNEL_BLUE'mean' != $value) { + echo "Channel blue is wrong " . $channelStatisticsImagick::CHANNEL_BLUE'mean' . " vs " . $value. "\n"; + } + + echo "Stats checked\n"; +} + +function affineTransformImage() { + $imagick = new \Imagick(); + $imagick->newPseudoImage(640, 640, "xc:black"); + $draw = new \ImagickDraw(); + + $angle = deg2rad(45); + //$angle = deg2rad(3); + + $draw->setFillColor('white'); + $draw->setStrokeColor('white'); + $draw->setStrokeWidth(10.0); + $draw->setStrokeLineCap(Imagick::LINECAP_SQUARE); + $draw->setStrokeLineJoin(Imagick::LINEJOIN_BEVEL); + + $draw->line( + $start_x = -50, + $start_y = -50, + $end_x = 690, + $end_y = 690 + ); + + $imagick->drawImage($draw); + + $draw = new \ImagickDraw(); + + $affineRotate = array( + "sx" => cos($angle), "sy" => cos($angle), + "rx" => sin($angle), "ry" => -sin($angle), + "tx" => 0, "ty" => 0, + ); + + $draw->affine($affineRotate); + + $imagick->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_BLACK); + $imagick->affineTransformImage($draw); + $imagick->setImagePage($imagick->getimageWidth(), $imagick->getimageheight(), 0, 0); + + $imagick->cropImage( + $imagick->getImageWidth() - 40, + $imagick->getImageHeight() - 40, + 20, + 20 + ); + + $imagick->setImageFormat('png'); + $imagick->writeImage(__DIR__ . '/test_031.png'); + + + $lineCheckBlack = clone $imagick; + $blackout = new \ImagickDraw(); + $blackout->setStrokeColor('black'); + $blackout->setFillColor('black'); + $blackout->rectangle( + ($lineCheckBlack->getImageWidth() / 2) - 20, + 0, + ($lineCheckBlack->getImageWidth() / 2) + 20, + $lineCheckBlack->getImageHeight() + ); + + $lineCheckBlack->drawImage($blackout); + // $lineCheckBlack->writeImage(__DIR__ . '/test_031_blank.png'); + + $whiteout = new \ImagickDraw(); + $lineCheckWhite = clone $imagick; + $whiteout->setStrokeColor('white'); + $whiteout->setFillColor('white'); + $whiteout->rectangle( + ($lineCheckBlack->getImageWidth() / 2) - 4, + 0, + 0, + $lineCheckBlack->getImageHeight() + ); + $whiteout->rectangle( + ($lineCheckWhite->getImageWidth() / 2) + 4, + 0, + $lineCheckWhite->getImageWidth(), + $lineCheckWhite->getImageHeight() + ); + + $lineCheckWhite->drawImage($whiteout); + // $lineCheckWhite->writeImage(__DIR__ . '/test_031_white.png'); + + $channelStatistics = $lineCheckWhite->getImageChannelStatistics(); + + echo "Checking white\n"; + checkAllStatsAreValue($channelStatistics, Imagick::getQuantum()); + + + $channelStatistics = $lineCheckBlack->getImageChannelStatistics(); +// var_dump( +// "lineCheckBlack channel stats are:", +// $channelStatistics +// ); + + echo "Checking black\n"; + checkAllStatsAreValue($channelStatistics, 0); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +affineTransformImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . "/test_031.png"; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Checking white +Stats checked +Checking black +Stats checked +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/032_Imagick_addNoiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/032_Imagick_addNoiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/033_Imagick_autoLevelImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/033_Imagick_autoLevelImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/034_Imagick_annotateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/034_Imagick_annotateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/035_Imagick_blackThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/035_Imagick_blackThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/036_Imagick_blueShiftImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/036_Imagick_blueShiftImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/037_Imagick_blurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/037_Imagick_blurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/038_Imagick_brightnessContrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/038_Imagick_brightnessContrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/039_Imagick_borderImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/039_Imagick_borderImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/039_Imagick_borderImage_im7.phpt
Changed
(renamed from imagick-3.7.0/tests/039_Imagick_borderImage_im7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/040_Imagick_charcoalImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/040_Imagick_charcoalImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/041_Imagick_chopImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/041_Imagick_chopImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/042_Imagick_clutImage_basic.phpt
Added
@@ -0,0 +1,60 @@ +--TEST-- +Test Imagick, clutImage +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(0); +$draw->setFillColor('black'); +$points = + 'x' => 40 * 3, 'y' => 10 * 5, + 'x' => 20 * 3, 'y' => 20 * 5, + 'x' => 70 * 3, 'y' => 50 * 5, + 'x' => 80 * 3, 'y' => 15 * 5, +; +$draw->polygon($points); +$imagick = new \Imagick(); + +$imagick->setColorspace(\Imagick::COLORSPACE_GRAY); + +$imagick->newPseudoImage( + 300, 300, + "xc:white" +); + +$imagick->drawImage($draw); +$imagick->blurImage(0, 10); + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(1); +$draw->setFillColor('red'); +$draw->point(0, 2); +$draw->setFillColor('yellow'); +$draw->rectangle(0, 0, 1, 1); +$gradient = new Imagick(); +$gradient->newPseudoImage(1, 5, 'xc:black'); +$gradient->drawImage($draw); +$gradient->setImageFormat('png'); + + + +$imagick->setImageFormat('png'); + +// This test is for IM < 7 so setInterpolate not available +// Which probably means the clutImage method isn't usuable... +//$imagick->setInterpolateMethod(Imagick::INTERPOLATE_BILINEAR); +$imagick->clutImage($gradient); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + + +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/042_Imagick_clutImage_im7.phpt
Added
@@ -0,0 +1,59 @@ +--TEST-- +Test Imagick, clutImageWithInterpolate +--SKIPIF-- +<?php + +require_once(dirname(__FILE__) . '/skipif.inc'); + +checkClassMethods('Imagick', array('clutImageWithInterpolate')); + +?> +--FILE-- +<?php + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(0); +$draw->setFillColor('black'); +$points = + 'x' => 40 * 3, 'y' => 10 * 5, + 'x' => 20 * 3, 'y' => 20 * 5, + 'x' => 70 * 3, 'y' => 50 * 5, + 'x' => 80 * 3, 'y' => 15 * 5, +; +$draw->polygon($points); +$imagick = new \Imagick(); + +$imagick->setColorspace(\Imagick::COLORSPACE_GRAY); + +$imagick->newPseudoImage( + 300, 300, + "xc:white" +); + + +$imagick->drawImage($draw); +$imagick->blurImage(0, 10); + +$draw = new \ImagickDraw(); +$draw->setStrokeOpacity(1); +$draw->setFillColor('red'); +$draw->point(0, 2); +$draw->setFillColor('yellow'); +$draw->rectangle(0, 0, 1, 1); +$gradient = new Imagick(); +$gradient->newPseudoImage(1, 5, 'xc:black'); +$gradient->drawImage($draw); + + +$imagick->setImageFormat('png'); +$imagick->clutImageWithInterpolate($gradient, Imagick::INTERPOLATE_BILINEAR); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +// $imagick->writeImage(__DIR__ . "/feels_bad_man.png"); + +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/043_Imagick_colorizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/043_Imagick_colorizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/044_Imagick_colorMatrixImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/044_Imagick_colorMatrixImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/045_Imagick_compositeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/045_Imagick_compositeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/046_Imagick_contrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/046_Imagick_contrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/047_Imagick_convolveImage_6.phpt
Changed
(renamed from imagick-3.7.0/tests/047_Imagick_convolveImage_6.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/047_Imagick_convolveImage_7.phpt
Changed
(renamed from imagick-3.7.0/tests/047_Imagick_convolveImage_7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/048_Imagick_cropImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/048_Imagick_cropImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/049_Imagick_deskewImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/049_Imagick_deskewImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/050_Imagick_distortImage_Affine.phpt
Changed
(renamed from imagick-3.7.0/tests/050_Imagick_distortImage_Affine.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/051_Imagick_distortImage_Projection.phpt
Changed
(renamed from imagick-3.7.0/tests/051_Imagick_distortImage_Projection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/052_Imagick_distortImage_Arc.phpt
Changed
(renamed from imagick-3.7.0/tests/052_Imagick_distortImage_Arc.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/053_Imagick_distortImage_RotatedArc.phpt
Changed
(renamed from imagick-3.7.0/tests/053_Imagick_distortImage_RotatedArc.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/054_Imagick_distortImage_Bilinear.phpt
Changed
(renamed from imagick-3.7.0/tests/054_Imagick_distortImage_Bilinear.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/055_Imagick_distortImage_ScaleRotateTransform.phpt
Changed
(renamed from imagick-3.7.0/tests/055_Imagick_distortImage_ScaleRotateTransform.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/056_Imagick_distortImage_Perspective.phpt
Changed
(renamed from imagick-3.7.0/tests/056_Imagick_distortImage_Perspective.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/057_Imagick_distortImage_PerspectiveProjection.phpt
Changed
(renamed from imagick-3.7.0/tests/057_Imagick_distortImage_PerspectiveProjection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/058_Imagick_distortImage_Polynomial.phpt
Changed
(renamed from imagick-3.7.0/tests/058_Imagick_distortImage_Polynomial.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/059_Imagick_distortImage_Polar.phpt
Changed
(renamed from imagick-3.7.0/tests/059_Imagick_distortImage_Polar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/060_Imagick_distortImage_Polar.phpt
Changed
(renamed from imagick-3.7.0/tests/060_Imagick_distortImage_Polar.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/061_Imagick_distortImage_Barrel.phpt
Changed
(renamed from imagick-3.7.0/tests/061_Imagick_distortImage_Barrel.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/062_Imagick_distortImage_BarrelInverse.phpt
Changed
(renamed from imagick-3.7.0/tests/062_Imagick_distortImage_BarrelInverse.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/063_Imagick_distortImage_Shepards.phpt
Changed
(renamed from imagick-3.7.0/tests/063_Imagick_distortImage_Shepards.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/064_cropThumbNailImage.phpt
Changed
(renamed from imagick-3.7.0/tests/064_cropThumbNailImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/065_Imagick_despeckleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/065_Imagick_despeckleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/066_Imagick_embossImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/066_Imagick_embossImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/067_Imagick_edgeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/067_Imagick_edgeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/068_Imagick_enhanceImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/068_Imagick_enhanceImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/069_Imagick_equalizeImage_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/069_Imagick_equalizeImage_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/070_Imagick_equalizeImage_case2.phpt
Changed
(renamed from imagick-3.7.0/tests/070_Imagick_equalizeImage_case2.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/071_Imagick_flipImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/071_Imagick_flipImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/072_Imagick_evaluateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/072_Imagick_evaluateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/073_Imagick_forwardFourierTransformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/073_Imagick_forwardFourierTransformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/074_Imagick_flopImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/074_Imagick_flopImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/075_Imagick_floodFillPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/075_Imagick_floodFillPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/076_Imagick_fxImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/076_Imagick_fxImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/077_Imagick_frameImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/077_Imagick_frameImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/077_Imagick_frameImage_im7.phpt
Changed
(renamed from imagick-3.7.0/tests/077_Imagick_frameImage_im7.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/078_Imagick_gammaImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/078_Imagick_gammaImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/079_Imagick_getImageGeometry_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/079_Imagick_getImageGeometry_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/080_Imagick_gaussianBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/080_Imagick_gaussianBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/081_Imagick_getImageHistogram_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/081_Imagick_getImageHistogram_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/083_Imagick_getPixelIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/083_Imagick_getPixelIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/084_Imagick_getPixelRegionIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/084_Imagick_getPixelRegionIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/085_Imagick_haldClutImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/085_Imagick_haldClutImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/086_Imagick_forwardFourierTransformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/086_Imagick_forwardFourierTransformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/087_Imagick_levelImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/087_Imagick_levelImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/088_Imagick_implodeImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/088_Imagick_implodeImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/088_Imagick_implodeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/088_Imagick_implodeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/089_Imagick_medianFilterImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/089_Imagick_medianFilterImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/090_Imagick_magnifyImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/090_Imagick_magnifyImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/091_Imagick_linearStretchImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/091_Imagick_linearStretchImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/092_Imagick_mergeImageLayers_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test Imagick, mergeImageLayers +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$layerMethodType = 13; + +function mergeImageLayers($layerMethodType) { + + $imagick = new \Imagick(); + $nextImage = null; + $imageNames = array( + "magick:NETSCAPE", + "magick:logo", + "magick:GRANITE", + ); + + foreach ($imageNames as $imageName) { + $nextImage = new \Imagick(); + $nextImage->newPseudoImage(640, 480, $imageName); + $imagick->addImage($nextImage); + } + + $imagick->resetIterator(); + + $imagick->setImageFormat('png'); + + $result = $imagick->mergeImageLayers($layerMethodType); + $bytes = $result->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +mergeImageLayers($layerMethodType); +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/093_Imagick_modulateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/093_Imagick_modulateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/094_Imagick_motionBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/094_Imagick_motionBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/095_Imagick_normalizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/095_Imagick_normalizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/096_Imagick_negateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/096_Imagick_negateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/097_Imagick_newPseudoImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/097_Imagick_newPseudoImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/098_Imagick_orderedPosterizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/098_Imagick_orderedPosterizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/099_Imagick_oilPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/099_Imagick_oilPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/099_Imagick_oilPaintImage_sigma.phpt
Changed
(renamed from imagick-3.7.0/tests/099_Imagick_oilPaintImage_sigma.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/100_Imagick_posterizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/100_Imagick_posterizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/101_Imagick_quantizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/101_Imagick_quantizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/102_Imagick_radialBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/102_Imagick_radialBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/103_Imagick_readImageBlob_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/103_Imagick_readImageBlob_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/104_Imagick_randomThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/104_Imagick_randomThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/105_Imagick_raiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/105_Imagick_raiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/106_Imagick_reduceNoiseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/106_Imagick_reduceNoiseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/107_Imagick_recolorImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/107_Imagick_recolorImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/108_Imagick_resampleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/108_Imagick_resampleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/109_Imagick_rollImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/109_Imagick_rollImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/110_Imagick_resizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/110_Imagick_resizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/111_Imagick_rotateImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/111_Imagick_rotateImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/112_Imagick_roundCorners_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/112_Imagick_roundCorners_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/113_Imagick_rotationalBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/113_Imagick_rotationalBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/114_Imagick_scaleImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/114_Imagick_scaleImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/115_Imagick_selectiveBlurImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/115_Imagick_selectiveBlurImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/116_Imagick_separateImageChannel_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/116_Imagick_separateImageChannel_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/117_Imagick_segmentImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/117_Imagick_segmentImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/118_Imagick_setImageArtifact_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/118_Imagick_setImageArtifact_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/119_Imagick_sepiaToneImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/119_Imagick_sepiaToneImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/120_Imagick_setCompressionQuality_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/120_Imagick_setCompressionQuality_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/121_Imagick_setImageBias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/121_Imagick_setImageBias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/122_Imagick_setImageCompressionQuality_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/122_Imagick_setImageCompressionQuality_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/123_Imagick_setImageClipMask_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/123_Imagick_setImageClipMask_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/125_Imagick_setImageOrientation_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/125_Imagick_setImageOrientation_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/126_Imagick_getImageChannelStats_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/126_Imagick_getImageChannelStats_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/127_Imagick_progressMonitor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/127_Imagick_progressMonitor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/130_Imagick_setOption_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/130_Imagick_setOption_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/131_Imagick_setOption_case2.phpt
Changed
(renamed from imagick-3.7.0/tests/131_Imagick_setOption_case2.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/132_Imagick_setOption_case3.phpt
Changed
(renamed from imagick-3.7.0/tests/132_Imagick_setOption_case3.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/133_Imagick_setSamplingFactors_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/133_Imagick_setSamplingFactors_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/134_Imagick_shadowImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/134_Imagick_shadowImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/135_Imagick_sharpenImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/135_Imagick_sharpenImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/136_Imagick_shadeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/136_Imagick_shadeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/137_Imagick_shearImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/137_Imagick_shearImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/138_Imagick_shaveImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/138_Imagick_shaveImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/139_Imagick_sigmoidalContrastImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/139_Imagick_sigmoidalContrastImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/141_Imagick_sketchImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/141_Imagick_sketchImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/142_Imagick_solarizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/142_Imagick_solarizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/143_Imagick_spreadImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/143_Imagick_spreadImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/143_Imagick_spreadImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/143_Imagick_spreadImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/144_Imagick_spliceImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/144_Imagick_spliceImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/145_imagickkernel_coverage.phpt
Added
@@ -0,0 +1,229 @@ +--TEST-- +ImagickKernel::fromMatrix test +--SKIPIF-- +<?php + +$imageMagickRequiredVersion = 0x680; +require_once(dirname(__FILE__) . '/skipif.inc'); + +?> +--FILE-- +<?php + + +$kernel = array( + array(1, 0, -1), + array(1, 0, -1), + array(1, 0, -1), +); + +$kernel = ImagickKernel::fromMatrix($kernel); +$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); +$kernel->addUnityKernel(0.50); +$imagick = new \Imagick(); +$imagick->newPseudoImage(640, 480, "magick:logo"); +$imagick->morphology( + \Imagick::MORPHOLOGY_CONVOLVE, + 1, + $kernel +); + + +$tests = array(); + +$tests = array( + "Cannot create kernel, matrix is empty.", + array() +); + +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array(0, 1, 1) +); + +//Should fail, matrix needs to have same number columns in each row +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array( + array(1, 0, 1), + array(1, 0, 1), + array(1, 0), + ) +); + +//Should fail, value instead of second row +$tests = array( + "Values must be matrix, with the same number of columns in each row.", + array( + array(0, 1), + 1 + ) +); + +//Should fail, value instead of second row +$tests = array( + "Only numbers or false are valid values in a kernel matrix.", + array( + array(0, 1), + array(0, new StdClass), + ) +); + +$tests = array( + "For kernels with even numbered rows or columns, the origin position must be specified.", + array( + array(1, 0), + ), +); + + +foreach ($tests as $test) { + + list($expectedMessage, $testValue) = $test; + + try { + $kernel = ImagickKernel::fromMatrix($testValue); + echo "Failed to throw exception".PHP_EOL; + } + catch(ImagickKernelException $e) { + if ($e->getMessage() != $expectedMessage) { + echo "Unexpected message ".$e->getMessage()." for test:".PHP_EOL; + var_dump($test); + } + } +} + + +try { + $kernel = ImagickKernel::fromBuiltin(\Imagick::KERNEL_DIAMOND, "CestNestPasUneKernel"); + //echo "builtIn OK".PHP_EOL; +} +catch(Exception $e) { + echo "Unexpected exception: ".$e->getMessage().PHP_EOL; +} + + +//Test adding unity kernel works. +$matrix1 = array( + array(1, 1, 1), + array(0, 0, 0), + array(-1, -1, -1), +); +$kernel = ImagickKernel::fromMatrix($matrix1); +$kernel->addUnityKernel(0.5); +$matrix = $kernel->getMatrix(); + +if ($matrix11 != 0.5) { + echo "center point should be 0.5 but is actually ".$matrix11.PHP_EOL; + var_dump($matrix); +} +//echo "Adding unity kernel ok".PHP_EOL; + +// Test adding kernel works and you can get the values back +$matrix1 = array( + array(1, 1), + array(0, 0), +); +$matrix2 = array( + array(0, 0), + array(1, 1), +); +$kernel1 = ImagickKernel::fromMatrix($matrix1, array(0, 0)); +$kernel2 = ImagickKernel::fromMatrix($matrix2, array(0, 0)); +$kernel1->addKernel($kernel2); + +$kernelList = $kernel1->separate(); +if (count($kernelList) != 2) { + echo "Incorrect number of matrixes returned."; +} +else { + if ($kernelList0->getMatrix() != $matrix1) { + echo "Matrix 1 does not match".PHP_EOL; + var_dump($kernelList0); + } + if ($kernelList1->getMatrix() != $matrix2) { + echo "Matrix 2 does not match".PHP_EOL; + var_dump($kernelList1); + } +} + +//Test Scaling +$matrixIn = array( + array(-1, 0, -1), + array( 0, 8, 0), + array(-1, 0, -1), +); +$kernel = ImagickKernel::fromMatrix($matrixIn); +$kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); +$matrixOut = $kernel->getMatrix(); + +if ($matrixOut11 != 2) { + echo "Matrix was not normalised correctly."; + var_dump($matrixOut); +} + + + +//Test single line kernel works +$matrixIn = array( + array(1, 0), +); +$kernel = ImagickKernel::fromMatrix($matrixIn, array(1, 0)); +if ($kernel->getMatrix() != $matrixIn) { + echo "Values do not match for 'Test single line kernel works'".PHP_EOL; +} + +//Test even sized kernel works +$matrixIn = array( + array(-1, 0), + array( 0, 1) +); +$kernel = ImagickKernel::fromMatrix($matrixIn, array(0, 1)); +if ($kernel->getMatrix() != $matrixIn) { + echo "Values do not match for 'Test even sized kernel works'".PHP_EOL; +} + +//Test 'wrong' order matrix is converted correctly. +$matrix = array( + array(0.0, 1.0), + array(0.5, false) +); + +$outOfOrderMatrix = array(); +$outOfOrderMatrix11 = $matrix11; +$outOfOrderMatrix10 = $matrix10; +$outOfOrderMatrix01 = $matrix01; +$outOfOrderMatrix00 = $matrix00; + +$kernel = ImagickKernel::fromMatrix($outOfOrderMatrix, array(0, 0)); +$kernelMatrix = $kernel->getMatrix();
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/149_Imagick_sparseColorImage.phpt
Changed
(renamed from imagick-3.7.0/tests/149_Imagick_sparseColorImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/150_Imagick_setregistry.phpt
Changed
(renamed from imagick-3.7.0/tests/150_Imagick_setregistry.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/151_Imagick_subImageMatch_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/151_Imagick_subImageMatch_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/152_Imagick_swirlImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/152_Imagick_swirlImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/152_Imagick_swirlImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/152_Imagick_swirlImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/153_Imagick_statisticImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/153_Imagick_statisticImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/154_Imagick_textureImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/154_Imagick_textureImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/155_Imagick_thresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/155_Imagick_thresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/156_Imagick_tintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/156_Imagick_tintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/157_Imagick_thumbnailImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/157_Imagick_thumbnailImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/158_Imagick_transposeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/158_Imagick_transposeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/159_Imagick_transformImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/159_Imagick_transformImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/160_Imagick_transparentPaintImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/160_Imagick_transparentPaintImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/161_Imagick_transformImageColorspace_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/161_Imagick_transformImageColorspace_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/162_Imagick_transverseImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/162_Imagick_transverseImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/163_Imagick_uniqueImageColors_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/163_Imagick_uniqueImageColors_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/164_Imagick_trimImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/164_Imagick_trimImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/165_Imagick_unsharpMaskImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/165_Imagick_unsharpMaskImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/166_Imagick_waveImageWithMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/166_Imagick_waveImageWithMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/166_Imagick_waveImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/166_Imagick_waveImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/167_Imagick_vignetteImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/167_Imagick_vignetteImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/168_Imagick_whiteThresholdImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/168_Imagick_whiteThresholdImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/169_ImagickPixel_construct_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/169_ImagickPixel_construct_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/170_ImagickPixel_setColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/170_ImagickPixel_setColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/171_ImagickPixel_setColorValue_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/171_ImagickPixel_setColorValue_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/172_ImagickPixel_setColorValueQuantum_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/172_ImagickPixel_setColorValueQuantum_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/173_ImagickDraw_bezier_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/173_ImagickDraw_bezier_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/174_ImagickDraw_affine_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/174_ImagickDraw_affine_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/175_ImagickDraw_arc_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/175_ImagickDraw_arc_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/176_ImagickDraw_ellipse_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/176_ImagickDraw_ellipse_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/177_ImagickDraw_composite_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/177_ImagickDraw_composite_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/178_ImagickDraw_circle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/178_ImagickDraw_circle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/179_ImagickDraw_line_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/179_ImagickDraw_line_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/180_ImagickDraw_matte_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/180_ImagickDraw_matte_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/181_ImagickDraw_pathStart_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/181_ImagickDraw_pathStart_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/182_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/183_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/183_ImagickDraw_pathCurveToQuadraticBezierAbsolute_basic.phpt
Added
@@ -0,0 +1,64 @@ +--TEST-- +Test ImagickDraw, pathCurveToQuadraticBezierAbsolute +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) { + + $draw = new \ImagickDraw(); + + $draw->setStrokeOpacity(1); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + + $draw->setStrokeWidth(2); + $draw->setFontSize(72); + + $draw->pathStart(); + $draw->pathMoveToAbsolute(50,250); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is the first two params, and the end point is the last two params. + $draw->pathCurveToQuadraticBezierAbsolute( + 150,50, + 250,250 + ); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is mirrored from the previous curves control point + // and the end point is defined by the x, y values. + $draw->pathCurveToQuadraticBezierSmoothAbsolute( + 450,250 + ); + + // This specifies a quadratic bezier curve with the current position as the start + // point, the control point is mirrored from the previous curves control point + // and the end point is defined relative from the current position by the x, y values. + $draw->pathCurveToQuadraticBezierSmoothRelative( + 200,-100 + ); + + $draw->pathFinish(); + + $imagick = new \Imagick(); + $imagick->newImage(700, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +} + +pathCurveToQuadraticBezierAbsolute($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/184_ImagickDraw_polyline_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/184_ImagickDraw_polyline_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/185_ImagickDraw_point_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/185_ImagickDraw_point_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/186_ImagickDraw_polygon_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/186_ImagickDraw_polygon_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/187_ImagickDraw_push_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/191_ImagickDraw_push_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/188_ImagickDraw_pushPattern_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/193_ImagickDraw_pushPattern_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/189_ImagickDraw_setClipPath_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/189_ImagickDraw_setClipPath_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/190_ImagickDraw_popDefs_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/190_ImagickDraw_popDefs_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/191_ImagickDraw_push_basic.phpt
Added
@@ -0,0 +1,41 @@ +--TEST-- +Test ImagickDraw, push +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; +$fillModifiedColor = 'LightCoral'; + +function push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) { + + $draw = new \ImagickDraw(); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillModifiedColor); + $draw->setStrokeWidth(2); + $draw->setFontSize(72); + $draw->push(); + $draw->translate(50, 50); + $draw->rectangle(200, 200, 300, 300); + $draw->pop(); + $draw->setFillColor($fillColor); + $draw->rectangle(200, 200, 300, 300); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +push($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/192_ImagickDraw_setClipPath_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/198_ImagickDraw_setClipPath_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/193_ImagickDraw_pushPattern_basic.phpt
Added
@@ -0,0 +1,59 @@ +--TEST-- +Test ImagickDraw, pushPattern +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function pushPattern($strokeColor, $fillColor, $backgroundColor) { + $draw = new \ImagickDraw(); + + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + $draw->setStrokeWidth(1); + $draw->setStrokeOpacity(1); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + + $draw->setStrokeWidth(1); + + $draw->pushPattern("MyFirstPattern", 0, 0, 50, 50); + for ($x = 0; $x < 50; $x += 10) { + for ($y = 0; $y < 50; $y += 5) { + $positionX = $x + (($y / 5) % 5); + $draw->rectangle($positionX, $y, $positionX + 5, $y + 5); + } + } + $draw->popPattern(); + + $draw->setFillOpacity(0); + $draw->rectangle(100, 100, 400, 400); + $draw->setFillOpacity(1); + + $draw->setFillOpacity(1); + + $draw->push(); + $draw->setFillPatternURL('#MyFirstPattern'); + $draw->setFillColor('yellow'); + $draw->rectangle(100, 100, 400, 400); + $draw->pop(); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +pushPattern($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/194_ImagickDraw_rectangle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/194_ImagickDraw_rectangle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/195_ImagickDraw_rotate_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/195_ImagickDraw_rotate_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/196_ImagickDraw_scale_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/196_ImagickDraw_scale_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/197_ImagickDraw_roundRectangle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/197_ImagickDraw_roundRectangle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/198_ImagickDraw_setClipPath_basic.phpt
Added
@@ -0,0 +1,42 @@ +--TEST-- +Test ImagickDraw, setClipPath +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + +function setClipPath($strokeColor, $fillColor, $backgroundColor) { + + $draw = new \ImagickDraw(); + $draw->setStrokeColor($strokeColor); + $draw->setFillColor($fillColor); + $draw->setStrokeOpacity(1); + $draw->setStrokeWidth(2); + + $clipPathName = 'testClipPath'; + + $draw->pushClipPath($clipPathName); + $draw->rectangle(0, 0, 250, 250); + $draw->popClipPath(); + $draw->setClipPath($clipPathName); + $draw->rectangle(100, 100, 400, 400); + + $imagick = new \Imagick(); + $imagick->newImage(500, 500, $backgroundColor); + $imagick->setImageFormat("png"); + + $imagick->drawImage($draw); + + $bytes = $imagick->getImageBlob(); + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +setClipPath($strokeColor, $fillColor, $backgroundColor) ; +echo "Ok"; +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/199_ImagickDraw_setClipRule_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/199_ImagickDraw_setClipRule_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/200_ImagickDraw_setClipUnits_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/200_ImagickDraw_setClipUnits_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/201_ImagickDraw_setFillAlpha_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/201_ImagickDraw_setFillAlpha_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/202_ImagickDraw_setFillColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/202_ImagickDraw_setFillColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/203_ImagickDraw_setFillRule_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/203_ImagickDraw_setFillRule_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/204_ImagickDraw_setFillOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/204_ImagickDraw_setFillOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/206_ImagickDraw_setFontSize_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/206_ImagickDraw_setFontSize_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/207_ImagickDraw_setFontFamily_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/207_ImagickDraw_setFontFamily_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/208_ImagickDraw_setFontStretch_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/208_ImagickDraw_setFontStretch_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/209_ImagickDraw_setFontWeight_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/209_ImagickDraw_setFontWeight_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/210_ImagickDraw_setFontStyle_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/210_ImagickDraw_setFontStyle_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/211_ImagickDraw_setStrokeAntialias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/211_ImagickDraw_setStrokeAntialias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/212_ImagickDraw_setGravity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/212_ImagickDraw_setGravity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/213_ImagickDraw_setStrokeAlpha_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/213_ImagickDraw_setStrokeAlpha_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/214_ImagickDraw_setStrokeDashOffset_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/214_ImagickDraw_setStrokeDashOffset_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/215_ImagickDraw_setStrokeColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/215_ImagickDraw_setStrokeColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/216_ImagickDraw_setStrokeDashArray_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/216_ImagickDraw_setStrokeDashArray_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/217_ImagickDraw_setStrokeMiterLimit_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/217_ImagickDraw_setStrokeMiterLimit_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/218_ImagickDraw_setStrokeLineCap_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/218_ImagickDraw_setStrokeLineCap_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/219_ImagickDraw_setStrokeLineJoin_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/219_ImagickDraw_setStrokeLineJoin_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/220_ImagickDraw_setStrokeOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/220_ImagickDraw_setStrokeOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/221_ImagickDraw_setStrokeWidth_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/221_ImagickDraw_setStrokeWidth_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/222_ImagickDraw_setTextAlignment_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/222_ImagickDraw_setTextAlignment_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/223_ImagickDraw_setTextAntialias_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/223_ImagickDraw_setTextAntialias_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/224_ImagickDraw_setTextUnderColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/224_ImagickDraw_setTextUnderColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/225_ImagickDraw_setTextDecoration_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/225_ImagickDraw_setTextDecoration_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/226_ImagickDraw_setViewBox_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/226_ImagickDraw_setViewBox_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/227_ImagickDraw_skewY_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/227_ImagickDraw_skewY_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/228_ImagickDraw_skewX_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/228_ImagickDraw_skewX_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/229_Tutorial_fxAnalyzeImage_case1.phpt
Changed
(renamed from imagick-3.7.0/tests/229_Tutorial_fxAnalyzeImage_case1.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/234_Tutorial_edgeExtend_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/234_Tutorial_edgeExtend_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/235_ImagickDraw_translate_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/235_ImagickDraw_translate_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/236_Imagick_identify_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/236_Imagick_identify_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/237_Tutorial_deconstructGif_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/237_Tutorial_deconstructGif_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/239_Tutorial_gradientReflection_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/239_Tutorial_gradientReflection_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/240_Tutorial_imagickCompositeGen_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/240_Tutorial_imagickCompositeGen_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/241_Tutorial_psychedelicFont_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/241_Tutorial_psychedelicFont_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/242_Tutorial_levelizeImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/242_Tutorial_levelizeImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/243_Tutorial_svgExample_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/243_Tutorial_svgExample_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/244_Tutorial_psychedelicFontGif_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/244_Tutorial_psychedelicFontGif_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/245_Tutorial_screenEmbed_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/245_Tutorial_screenEmbed_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/246_antialias_image.phpt
Added
@@ -0,0 +1,28 @@ +--TEST-- +Test pseudo formats +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +$im = new Imagick(); +$im->newPseudoImage(10, 10, "magick:logo"); +//On by default +var_export($im->getAntiAlias()); +echo PHP_EOL; + +//Turn off +$im->setAntiAlias(false); +var_export($im->getAntiAlias()); +echo PHP_EOL; + +//Turn back on +$im->setAntiAlias(true); +var_export($im->getAntiAlias()); +echo PHP_EOL; + +?> +--EXPECTF-- +true +false +true
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/247_ImagickPixelIterator_construct_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/252_ImagickPixelIterator_construct_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/248_ImagickPixelIterator_clear_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/248_ImagickPixelIterator_clear_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/250_ImagickPixelIterator_resetIterator_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/250_ImagickPixelIterator_resetIterator_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/252_ImagickPixelIterator_construct_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test ImagickPixelIterator, construct +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x675; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + + +function construct() { + $imagick = new \Imagick(); + $imagick->newPseudoImage(640, 480, "magick:logo"); + $imageIterator = new \ImagickPixelIterator($imagick); + + /* Loop through pixel rows */ + foreach ($imageIterator as $pixels) { + /* Loop through the pixels in the row (columns) */ + foreach ($pixels as $column => $pixel) { + /** @var $pixel \ImagickPixel */ + if ($column % 2) { + /* Paint every second pixel black*/ + $pixel->setColor("rgba(0, 0, 0, 0)"); + } + } + /* Sync the iterator, this is important to do on each iteration */ + $imageIterator->syncIterator(); + } + + $bytes = $imagick; + if (strlen($bytes) <= 0) { echo "Failed to generate image.";} +} + +construct() ; +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/253_getHdri.phpt
Changed
(renamed from imagick-3.7.0/tests/253_getHdri.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/254_getConfigureOptions.phpt
Added
@@ -0,0 +1,160 @@ +--TEST-- +Test Imagick::getConfigureOptions +--SKIPIF-- +<?php + +require_once(dirname(__FILE__) . '/skipif.inc'); + +checkClassMethods('Imagick', array('getconfigureoptions')); + + +?> +--FILE-- +<?php + +$allOptions = Imagick::getConfigureOptions(); + +if (!is_array($allOptions)) { + echo "Failed to return array".PHP_EOL; + var_dump($allOptions); +} +else if (count($allOptions) == 0) { + echo "allOptions is empty".PHP_EOL; +} + + +$optionsStartingWithC = Imagick::getConfigureOptions("Q*"); + +if (!is_array($optionsStartingWithC)) { + echo "Failed to return array".PHP_EOL; + var_dump($optionsStartingWithC); +} +else if (count($optionsStartingWithC) == 0) { + echo "optionsStartingWithC is empty".PHP_EOL; + echo "All options are:\n"; + var_dump(Imagick::getConfigureOptions()); +} + +//Example output on Debian +// +//array(38) { +// "CC"=> +// string(3) "gcc" +// "CFLAGS"=> +// string(186) "-I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -fopenmp -Wall -g -O2 -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" +// "CODER_PATH"=> +// string(56) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders" +// "CONFIGURE"=> +// string(155) "./configure '--with-quantum-depth=16' '--with-magick-plus-plus=no' '--without-perl' '--disable-static' '--disable-docs' '--with-jpeg=yes' '--with-png=yes'" +// "CONFIGURE_PATH"=> +// string(29) "/usr/local/etc/ImageMagick-7/" +// "COPYRIGHT"=> +// string(46) "Copyright (C) 1999-2021 ImageMagick Studio LLC" +// "CPPFLAGS"=> +// string(34) "-I/usr/local/include/ImageMagick-7" +// "CXX"=> +// string(3) "g++" +// "CXXFLAGS"=> +// string(9) " -pthread" +// "DEFS"=> +// string(15) "-DHAVE_CONFIG_H" +// "DELEGATES"=> +// string(33) "freetype jng jpeg png ps xml zlib" +// "DISTCHECK_CONFIG_FLAGS"=> +// string(217) " --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-fftw=no --with-gslib=no --with-fontpath= --with-jxl=no --with-rsvg=no --with-wmf=no --with-perl=no " +// "DOCUMENTATION_PATH"=> +// string(34) "/usr/local/share/doc/ImageMagick-7" +// "EXEC-PREFIX"=> +// string(10) "/usr/local" +// "EXECUTABLE_PATH"=> +// string(14) "/usr/local/bin" +// "FEATURES"=> +// string(22) "DPC HDRI Cipher OpenMP" +// "FILTER_PATH"=> +// string(57) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/filters" +// "GIT_REVISION"=> +// string(24) "18571:309fcfa1c:20210328" +// "HOST"=> +// string(19) "x86_64-pc-linux-gnu" +// "INCLUDE_PATH"=> +// string(32) "/usr/local/include/ImageMagick-7" +// "LDFLAGS"=> +// string(17) "-L/usr/local/lib " +// "LIB_VERSION"=> +// string(5) "0x70B" +// "LIB_VERSION_NUMBER"=> +// string(8) "7,0,11,6" +// "LIBRARY_PATH"=> +// string(33) "/usr/local/lib/ImageMagick-7.0.11" +// "LIBS"=> +// string(96) " -lfreetype -ljpeg -lpng16 -lxml2 -lz -lm -lpthread -lgomp" +// "MAGICK_TEMPORARY_PATH"=> +// string(4) "/tmp" +// "NAME"=> +// string(11) "ImageMagick" +// "PCFLAGS"=> +// string(65) "-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" +// "PREFIX"=> +// string(10) "/usr/local" +// "QuantumDepth"=> +// string(2) "16" +// "RELEASE_DATE"=> +// string(10) "2021-03-28" +// "SHARE_PATH"=> +// string(30) "/usr/local/share/ImageMagick-7" +// "SHAREARCH_PATH"=> +// string(48) "/usr/local/lib/ImageMagick-7.0.11/config-Q16HDRI" +// "TARGET_CPU"=> +// string(6) "x86_64" +// "TARGET_OS"=> +// string(9) "linux-gnu" +// "TARGET_VENDOR"=> +// string(2) "pc" +// "VERSION"=> +// string(6) "7.0.11" +// "WEBSITE"=> +// string(23) "https://imagemagick.org" +//} + + + +// Examples of output on nixos +//array(5) { +// "DELEGATES"=> +// string(102) "bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg lcms lzma openexr png rsvg tiff webp x xml zlib" +// "FEATURES"=> +// string(28) "Cipher DPC HDRI OpenMP(4.5) " +// "MAGICK_TEMPORARY_PATH"=> +// string(4) "/tmp" +// "NAME"=> +// string(11) "ImageMagick" +// "QuantumDepth"=> +// string(3) "Q16" +//} + + + + + + + + +if (!(count($optionsStartingWithC) < count($allOptions))) { + echo ""; + var_dump($optionsStartingWithC); + var_dump($allOptions); +} + +foreach ($optionsStartingWithC as $key => $value) { + $key = strtolower($key); + + if (stripos($key, "q") !== 0) { + echo "key $key does not start with c".PHP_EOL; + } +} + +echo "Ok"; + +?> +--EXPECTF-- +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/255_getFeatures.phpt
Changed
(renamed from imagick-3.7.0/tests/255_getFeatures.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/256_Imagick_exportImagePixels_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/256_Imagick_exportImagePixels_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/257_Imagick_setImageChannelMask_basic.phpt
Added
@@ -0,0 +1,39 @@ +--TEST-- +Test Imagick, Imagick::exportImagePixels +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x700; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +$imagick = new \Imagick(); +$imagick->newPseudoImage(256, 256, "gradient:black-white"); + +$initialMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_RED); +$imagick->brightnessContrastImage(-20, 20); +$imagick->setImageFormat("png"); +$imagick->writeImage(__DIR__ . "/maskTest.png"); + +$redMask = $imagick->setImageChannelMask(\Imagick::CHANNEL_DEFAULT); + +if ($initialMask != \Imagick::CHANNEL_DEFAULT) { + echo "initialMask is not equal to \Imagick::CHANNEL_DEFAULT but instead is $initialMask\n"; +} + +if ($redMask != \Imagick::CHANNEL_RED) { + echo "redMask is not equal to \Imagick::CHANNEL_RED but instead is $redMask\n"; +} + +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/maskTest.png'; +if (file_exists($f)) { + unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/258_Imagick_evaluateImages_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/258_Imagick_evaluateImages_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/259_Imagick_colorPoints_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/259_Imagick_colorPoints_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/260_localContrastImage.phpt
Changed
(renamed from imagick-3.7.0/tests/260_localContrastImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/261_compositeImageGravity.phpt
Changed
(renamed from imagick-3.7.0/tests/261_compositeImageGravity.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/262_autoOrient.phpt
Changed
(renamed from imagick-3.7.0/tests/262_autoOrient.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/263_autoGammaImage.phpt
Added
@@ -0,0 +1,22 @@ +--TEST-- +Test autoGammaImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('autoGammaImage')); +?> +--FILE-- +<?php + +$im = new Imagick("magick:logo"); +$im->autoGammaImage(); + + +$im = new Imagick("magick:logo"); +$im->autoGammaImage(\Imagick::CHANNEL_RED); + +echo "Ok"; + +?> +--EXPECT-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/264_ImagickDraw_getTextDirection_basic.phpt
Added
@@ -0,0 +1,73 @@ +--TEST-- +Test ImagickDraw, getTextDirection +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('ImagickDraw', array('getTextDirection', 'setTextDirection')); +?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/functions.inc'); + +$backgroundColor = 'rgb(225, 225, 225)'; +$strokeColor = 'rgb(0, 0, 0)'; +$fillColor = 'DodgerBlue2'; + + + +$draw = new \ImagickDraw(); +setFontForImagickDraw($draw); + +$draw->setStrokeColor($strokeColor); +$draw->setFillColor($fillColor); + +$draw->setStrokeWidth(2); +$draw->setFontSize(56); + +$directions = array( + \Imagick::DIRECTION_LEFT_TO_RIGHT, + \Imagick::DIRECTION_RIGHT_TO_LEFT, + \Imagick::DIRECTION_LEFT_TO_RIGHT, +); + +$i = 0; +foreach ($directions as $directionToSet) { + $draw->setTextDirection($directionToSet); + $directionReturned = $draw->getTextDirection(); + + if ($directionReturned != $directionToSet) { + echo "Direction error for $i \n"; + } + + $position = 36; + if ($directionToSet == \Imagick::DIRECTION_RIGHT_TO_LEFT) { + $position = 500 - 36; + } + + $draw->annotation($position, (72 * $i) + 64, "Lorem Ipsum!"); + + $i++; +} + +$imagick = new \Imagick(); +$imagick->newImage(500, 500, $backgroundColor); +$imagick->setImageFormat("png"); +$imagick->drawImage($draw); + +$bytes = $imagick->getImageBlob(); +if (strlen($bytes) <= 0) { echo "Failed to generate image.";} + +$imagick->writeImage(__DIR__ . '/directionTest.png'); + +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/directionTest.png'; +if (file_exists($f)) { + unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/265_ImagickDraw_getOpacity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/265_ImagickDraw_getOpacity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/266_ImagickDraw_getFontResolution_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/266_ImagickDraw_getFontResolution_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/267_ImagickDraw_getBorderColor_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/267_ImagickDraw_getBorderColor_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/268_ImagickDraw_getDensity_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/268_ImagickDraw_getDensity_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/269_ImagickPixel_setColorFromPixel_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/269_ImagickPixel_setColorFromPixel_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/270_imagick_restoreErrorHandler.phpt
Changed
(renamed from imagick-3.7.0/tests/270_imagick_restoreErrorHandler.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/271_imagick_constants.phpt
Changed
(renamed from imagick-3.7.0/tests/271_imagick_constants.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/272_imagick_identifyimagetype.phpt
Changed
(renamed from imagick-3.7.0/tests/272_imagick_identifyimagetype.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/273_imagick_falsyimage.phpt
Changed
(renamed from imagick-3.7.0/tests/273_imagick_falsyimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/274_imagick_setImageAlpha.phpt
Added
@@ -0,0 +1,79 @@ +--TEST-- +Imagick::setImageAlpha +--SKIPIF-- +<?php +$imageMagickRequiredVersion=0x700; +require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php + +require_once __DIR__ . "/../util/functions.php"; + +$imagick = new Imagick(); +$imagick->newPseudoImage(256, 256, 'xc:purple'); +$imagick->setImageAlpha(0.5); + +$imagick->setImageFormat('png'); +$imagick->writeImage(__DIR__ . "/setAlphaTest.png"); + +$pixelTypes = array( + Imagick::PIXEL_CHAR => array(128, 0, 128, 128), + Imagick::PIXEL_FLOAT => array(0.50196081399918, 0, 0.50196081399918, 0.5), + Imagick::PIXEL_DOUBLE => array(0.50196078431373, 0, 0.50196078431373, 0.5), + Imagick::PIXEL_SHORT => array(32896, 0, 32896, 32768), +); + +function getColorError($type, $expected, $actual) { + + if ($type == Imagick::PIXEL_CHAR || + $type == Imagick::PIXEL_SHORT) { + $string = "Expected: " . $actual . "\n"; + $string .= "Actual : " . $actual . "\n"; + + return $string; + } + + if ($type == Imagick::PIXEL_FLOAT) { + return float_compare_32($expected, $actual); + } + + if ($type == Imagick::PIXEL_DOUBLE) { + return float_compare($expected, $actual); + } + + echo "Unknown type: $type \n"; + exit(-1); +} + + +foreach ($pixelTypes as $pixelType => $expectedValues) { + $pixels = $imagick->exportImagePixels(0, 0, 1, 1, "RGBA", $pixelType); + $channelNames = 'R', 'G', 'B', 'A'; + + // Loop over the colours + for ($channel = 0; $channel < 4; $channel++) { + $actual = $pixels$channel; + $expected = $expectedValues$channel; + if (abs($actual - $expected) > get_epsilon_for_off_by_half_errors()) { + $channelName = $channelNames$channel; + + echo "Pixel values appear incorrect for pixelType $pixelType channel:$channelName\n"; + echo getColorError($pixelType, $expected, $actual); + break; + } + } +} + +echo "Ok"; + +?> +--CLEAN-- +<?php +$f = __DIR__ . '/setAlphaTest.png'; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/275_ImagickPixel_unitializedObjects.phpt
Changed
(renamed from imagick-3.7.0/tests/275_ImagickPixel_unitializedObjects.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/276_Imagick_artifacts.phpt
Changed
(renamed from imagick-3.7.0/tests/276_Imagick_artifacts.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/277_Imagick_colorDecisionListImage.phpt
Changed
(renamed from imagick-3.7.0/tests/277_Imagick_colorDecisionListImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/278_Imagick_optimaze_gif.phpt
Added
@@ -0,0 +1,86 @@ +--TEST-- +Test Imagick::optimizeimagelayers and Imagick::optimizeimagetransparency +--SKIPIF-- +<?php + +$imageMagickRequiredVersion = 0x686; + +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('optimizeimagelayers')); +checkClassMethods('Imagick', array('optimizeimagetransparency')); + +?> +--FILE-- +<?php + +function makeSimpleGif() { + $aniGif = new \Imagick(); + $aniGif->setFormat("gif"); + + $circleRadius = 20; + $imageFrames = 6; + $imageSize = 200; + + $background = new \Imagick(); + $background->newpseudoimage($imageSize, $imageSize, "canvas:gray"); + + $blackWhite = new \Imagick(); + $blackWhite->newpseudoimage($imageSize, $imageSize, "gradient:black-white"); + + $backgroundPalette = clone $background; + $backgroundPalette->quantizeImage(240, \Imagick::COLORSPACE_RGB, 8, false, false); + + $blackWhitePalette = clone $blackWhite; + $blackWhitePalette->quantizeImage(16, \Imagick::COLORSPACE_RGB, 8, false, false); + + $backgroundPalette->addimage($blackWhitePalette); + + for($count=0 ; $count<$imageFrames ; $count++) { + echo "Frame: ".$count."\n"; + $drawing = new \ImagickDraw(); + $drawing->setFillColor('white'); + $drawing->setStrokeColor('rgba(64, 64, 64, 0.8)'); + $strokeWidth = 4; + $drawing->setStrokeWidth($strokeWidth); + + $distanceToMove = $imageSize + (($circleRadius + $strokeWidth) * 2); + $offset = ($distanceToMove * $count / ($imageFrames -1)) - ($circleRadius + $strokeWidth); + $drawing->translate($offset, ($imageSize / 2) + ($imageSize / 3 * cos(20 * $count / $imageFrames))); + $drawing->circle(0, 0, $circleRadius, 0); + + $frame = clone $background; + $frame->drawimage($drawing); + $frame->clutimage($backgroundPalette); + $frame->setImageDelay(10); + $aniGif->addImage($frame); + } + + $aniGif = $aniGif->deconstructImages(); + + $bytes = $aniGif->getImagesBlob(); + if (strlen($bytes) <= 0) { + echo "Failed to generate image."; + } + + return $aniGif; +} + +function optimizeGif($im) { + $im = $im->coalesceImages(); + $im->optimizeImageLayers(); + $im->optimizeimagetransparency(); +} + +$simpleGif = makeSimpleGif(); +optimizeGif($simpleGif); + +echo "Ok" +?> +--EXPECT-- +Frame: 0 +Frame: 1 +Frame: 2 +Frame: 3 +Frame: 4 +Frame: 5 +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/279_ImagickDraw_setTextInterlineSpacing.phpt
Changed
(renamed from imagick-3.7.0/tests/279_ImagickDraw_setTextInterlineSpacing.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/280_imagickkernel_exception_invalid_origin.phpt
Changed
(renamed from imagick-3.7.0/tests/280_imagickkernel_exception_invalid_origin.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/281_imagick_houghLineImage_basic.phpt
Added
@@ -0,0 +1,38 @@ +--TEST-- +Test Imagick, houghLineImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('houghLineImage')); +?> +--FILE-- +<?php + + +function houghLineImage() { + $path = realpath(__DIR__ . '/houghline_input_image.png'); + + if ($path === false) { + echo "Image is not readable.\n"; + exit(-1); + } + + $imagick = new \Imagick(); + $imagick->readImage($path); + $imagick->setbackgroundcolor('rgb(64, 64, 64)'); + $imagick->houghLineImage(20,40, 40); + $imagick->writeImage(__DIR__ . '/houghline_output_image.png'); +} + +houghLineImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +$f = __DIR__ . '/houghline_output_image.png'; +if (file_exists($f)) { + @unlink($f); +} +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/281_ini_settings_default.phpt
Changed
(renamed from imagick-3.7.0/tests/281_ini_settings_default.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/282_ini_settings_set_falsy_string.phpt
Changed
(renamed from imagick-3.7.0/tests/282_ini_settings_set_falsy_string.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/283_ini_settings_set_falsy_zero.phpt
Changed
(renamed from imagick-3.7.0/tests/283_ini_settings_set_falsy_zero.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/284_ini_settings_set_truthy_number.phpt
Changed
(renamed from imagick-3.7.0/tests/284_ini_settings_set_truthy_number.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/285_ini_settings_set_truthy_string.phpt
Changed
(renamed from imagick-3.7.0/tests/285_ini_settings_set_truthy_string.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/286_Imagick_setMask_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/286_Imagick_setMask_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/287_Imagick_GetImageChannelRange_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/287_Imagick_GetImageChannelRange_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/288_imagick_prevent_zero_size_images.phpt
Changed
(renamed from imagick-3.7.0/tests/288_imagick_prevent_zero_size_images.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/289_Imagick_setImageMask_basic.phpt
Added
@@ -0,0 +1,69 @@ +--TEST-- +Test Imagick, medianFilterImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('getImageMask', 'setImageMask')); +?> +--FILE-- +<?php + +$canvas = new Imagick(__DIR__ . '/houghline_input_image.png'); + +$mask = new Imagick(); +$mask->newPseudoImage( + $canvas->getImageWidth(), + $canvas->getImageHeight(), + 'xc:black' +); + +$drawing = new ImagickDraw(); +$drawing->setBorderColor('black'); +$drawing->setFillColor('black'); +$drawing->rectangle(0, 0, $mask->getImageWidth(), $mask->getImageHeight()); + +$drawing->setBorderColor('white'); +$drawing->setFillColor('white'); +$drawing->circle( + $mask->getImageWidth() / 2, + $mask->getImageHeight() / 2, + 2 * $mask->getImageWidth() / 3, + $mask->getImageHeight() / 2 +); + +$mask->drawImage($drawing); +//$mask->writeImage(__DIR__ . "/test_mask.png"); + +// This would probably be more useful for users +// but shows the issue with PIXELMASK_COMPOSITE +// $mask->blurImage(10, 2); + +$mask_types = array( + \Imagick::PIXELMASK_READ => "PIXELMASK_READ", + \Imagick::PIXELMASK_WRITE => "PIXELMASK_WRITE", + \Imagick::PIXELMASK_COMPOSITE => "PIXELMASK_COMPOSITE", +); + +$channel_types = array( + \Imagick::CHANNEL_ALL => "CHANNEL_ALL", + \Imagick::CHANNEL_RED => "CHANNEL_RED", + \Imagick::CHANNEL_ALPHA => "CHANNEL_ALPHA", + \Imagick::CHANNEL_RGBA => "CHANNEL_RGBA", + \Imagick::CHANNEL_BLACK => "CHANNEL_BLACK", + \Imagick::CHANNEL_DEFAULT => "CHANNEL_DEFAULT", +); + +foreach ($channel_types as $channel_type => $channel_name) { + foreach ($mask_types as $type => $type_name) { + $output = clone $canvas; + $output->setImageMask($mask, $type); + + $output->blurImage(15, 4, $channel_type); +// $output->writeImage(__DIR__ . "/test_canvas" . $type_name . "_" . $channel_name . ".png"); + } +} + +echo "Ok"; +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/290_imagick_profileimage.phpt
Changed
(renamed from imagick-3.7.0/tests/290_imagick_profileimage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/291_reflection.phpt
Changed
(renamed from imagick-3.7.0/tests/291_reflection.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/292_index_iterator.phpt
Changed
(renamed from imagick-3.7.0/tests/292_index_iterator.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/294_Imagick_cannyEdgeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/294_Imagick_cannyEdgeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/295_Imagick_setSeed.phpt
Changed
(renamed from imagick-3.7.0/tests/295_Imagick_setSeed.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/296_Imagick_waveletDenoiseImage.phpt
Changed
(renamed from imagick-3.7.0/tests/296_Imagick_waveletDenoiseImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/297_Imagick_meanShiftImage.phpt
Changed
(renamed from imagick-3.7.0/tests/297_Imagick_meanShiftImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/298_Imagick_kmeansImage.phpt
Changed
(renamed from imagick-3.7.0/tests/298_Imagick_kmeansImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/299_Imagick_rangeThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/299_Imagick_rangeThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/300_Imagick_autoThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/300_Imagick_autoThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/301_Imagick_bilateralBlurImage.phpt
Changed
(renamed from imagick-3.7.0/tests/301_Imagick_bilateralBlurImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/302_Imagick_claheImage.phpt
Changed
(renamed from imagick-3.7.0/tests/302_Imagick_claheImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/303_Imagick_averageImages.phpt
Changed
(renamed from imagick-3.7.0/tests/303_Imagick_averageImages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/304_Imagick_is_imagemagick_borked.phpt
Changed
(renamed from imagick-3.7.0/tests/304_Imagick_is_imagemagick_borked.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/305_Imagick_complexImages.phpt
Changed
(renamed from imagick-3.7.0/tests/305_Imagick_complexImages.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/306_Imagick_interpolativeResizeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/306_Imagick_interpolativeResizeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/307_Imagick_levelImageColors.phpt
Changed
(renamed from imagick-3.7.0/tests/307_Imagick_levelImageColors.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/308_Imagick_levelizeImage.phpt
Changed
(renamed from imagick-3.7.0/tests/308_Imagick_levelizeImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/309_Imagick_orderedDitherImage.phpt
Changed
(renamed from imagick-3.7.0/tests/309_Imagick_orderedDitherImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/310_Imagick_whiteBalanceImage.phpt
Changed
(renamed from imagick-3.7.0/tests/310_Imagick_whiteBalanceImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/311_Imagick_channelFxImage.phpt
Changed
(renamed from imagick-3.7.0/tests/311_Imagick_channelFxImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/312_Imagick_colorThresholdImage.phpt
Changed
(renamed from imagick-3.7.0/tests/312_Imagick_colorThresholdImage.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/314_Imagick_getBackgroundColor.phpt
Changed
(renamed from imagick-3.7.0/tests/314_Imagick_getBackgroundColor.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/315_Imagick_getImageArtifacts.phpt
Changed
(renamed from imagick-3.7.0/tests/315_Imagick_getImageArtifacts.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/316_Imagick_getImageKurtosis.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Test Imagick, getImageKurtosis +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('getImageKurtosis')); +?> +--FILE-- +<?php + +require_once(__DIR__ . '/functions.inc'); + +function getImageKurtosis() { + $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); + $values = $imagick->getImageKurtosis(); + + check_value_posibilities( + $values, + "kurtosis", + -0.9379261035010518, -0.70925995674921 + ); + check_value_posibilities( + $values, + "skewness", + 0.4562517200972045, 0.56839010636614 + ); +} + +getImageKurtosis() ; +echo "Ok"; +?> +--EXPECTF-- +Value for 'kurtosis' is %f which is close enough to expected %f +Value for 'skewness' is %f which is close enough to expected %f +Ok \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/317_Imagick_getImageMean.phpt
Changed
(renamed from imagick-3.7.0/tests/317_Imagick_getImageMean.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/318_Imagick_getImageRange.phpt
Changed
(renamed from imagick-3.7.0/tests/318_Imagick_getImageRange.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/319_Imagick_getInterpolateMethod.phpt
Changed
(renamed from imagick-3.7.0/tests/319_Imagick_getInterpolateMethod.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/320_Imagick_getOptions.phpt
Changed
(renamed from imagick-3.7.0/tests/320_Imagick_getOptions.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/321_Imagick_getOrientation.phpt
Changed
(renamed from imagick-3.7.0/tests/321_Imagick_getOrientation.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/322_Imagick_getResolution.phpt
Changed
(renamed from imagick-3.7.0/tests/322_Imagick_getResolution.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/323_Imagick_getType.phpt
Changed
(renamed from imagick-3.7.0/tests/323_Imagick_getType.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/324_Imagick_polynomialImage.phpt
Added
@@ -0,0 +1,38 @@ +--TEST-- +Test Imagick, polynomialImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('polynomialImage')); +?> +--FILE-- +<?php + +function polynomialImage() { + $imagick = new \Imagick(__DIR__ . '/Biter_500.jpg'); + $imagick_gradient = new \Imagick(); + $imagick_gradient->newPseudoImage( + $imagick->getImageWidth(), + $imagick->getImageHeight(), + "gradient:black-white" + ); + + $imagick->addImage($imagick_gradient); + + $terms = 1, 1, 0.1, 0.1; + + // is 2 x (number_terms + 1 (the constant). + $imagick->polynomialImage($terms); + $imagick->writeImage(__DIR__ . '/polynomialImage_output_image.png'); + $imagick->getImageBlob(); +} + +polynomialImage() ; +echo "Ok"; +?> +--CLEAN-- +<?php +@unlink(__DIR__ . '/polynomialImage_output_image.png'); +?> +--EXPECTF-- +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/325_Imagick_setDepth.phpt
Added
@@ -0,0 +1,30 @@ +--TEST-- +Test Imagick, setDepth +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); +checkClassMethods('Imagick', array('setDepth')); +?> +--FILE-- +<?php + +function setDepth() { + $imagick = new \Imagick(); + + $imagick->setDepth(16); + $imagick->newPseudoImage(640, 480, "gradient:red-blue"); + + echo "Depth is " .$imagick->getImageDepth() . "\n"; + + // $imagick->getImageBlob(); + // TODO - check that the depth has actually worked? + // this could be done by generating a gradient, and counting the unique + // numbers of colours, or by looking at gradient artifacts. +} + +setDepth() ; +echo "Ok"; +?> +--EXPECTF-- +Depth is 16 +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/326_Imagick_setExtract.phpt
Changed
(renamed from imagick-3.7.0/tests/326_Imagick_setExtract.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/327_Imagick_polaroidImage_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/327_Imagick_polaroidImage_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt
Changed
(renamed from imagick-3.7.0/tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/329_imagick_getImageBlob_empty.phpt
Added
@@ -0,0 +1,23 @@ +--TEST-- +Imagick::getImageBlob behaviour on invalid images +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +// Fails due to image having no format +$imagick = new Imagick(); +try { + $imagick->newPseudoImage(200, 200, "xc:red"); + $result = $imagick->getImageBlob(); + echo "Imagick failed to throw exception" . PHP_EOL; +} catch (ImagickException $e) { + echo "ImagickException: " . $e->getMessage() . PHP_EOL; +} + +echo "Fin.\n"; + +?> +--EXPECTF-- +ImagickException: Failed to get the image contents (empty or invalid image?) +Fin. \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/330_Imagick_newImage.phpt
Added
@@ -0,0 +1,35 @@ +--TEST-- +Test Imagick, newImage +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . '/skipif.inc'); + +?> +--FILE-- +<?php + + +$image = new Imagick(); +$image->newImage(100, 100, new ImagickPixel('red'), 'png'); + +// Image format case changed at some point in IM +echo strtolower($image->getImageFormat()); +echo "\n"; + +$image = new Imagick(); +$image->newImage(100, 100, 'blue', null); + +try { + $image->getImageFormat(); + echo "Failed to throw exception"; +} +catch (ImagickException $ie) { + echo $ie->getMessage() . "\n"; +} + +echo "Ok"; +?> +--EXPECTF-- +png +Image has no format +Ok
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/Biter_500.jpg
Changed
(renamed from imagick-3.7.0/tests/Biter_500.jpg)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/OFL.txt
Changed
(renamed from imagick-3.7.0/tests/OFL.txt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/anonymous_pro_minus.ttf
Changed
(renamed from imagick-3.7.0/tests/anonymous_pro_minus.ttf)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug20636.phpt
Changed
(renamed from imagick-3.7.0/tests/bug20636.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug21229.phpt
Changed
(renamed from imagick-3.7.0/tests/bug21229.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug59378.phpt
Changed
(renamed from imagick-3.7.0/tests/bug59378.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug59378_windows.phpt
Changed
(renamed from imagick-3.7.0/tests/bug59378_windows.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug64015.phpt
Changed
(renamed from imagick-3.7.0/tests/bug64015.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug81235.phpt
Changed
(renamed from imagick-3.7.0/tests/bug81235.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_66098.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_66098.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_71742.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_71742.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_72226.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_72226.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/bug_73840.phpt
Changed
(renamed from imagick-3.7.0/tests/bug_73840.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/functions.inc
Added
@@ -0,0 +1,196 @@ +<?php + +/** + * + * Gets the installed version of ImageMagick and compares the + * appropriate version to the installed version. * + * + * @param $testIm6Version + * @param $im7Version + * @return int + */ +function version_compare_imagemagick($testIm6Version, $im7Version) +{ + $versionInfo = \Imagick::getVersion(); + + if (array_key_exists("versionString", $versionInfo) == false) { + die("skip unable to determine ImageMagick version."); + } + + $versionInstalledStringComplete = $versionInfo"versionString"; + + $firstSpace = strpos($versionInstalledStringComplete, ' '); + if ($firstSpace === false) { + die("Failed to understand version string $versionInstalledStringComplete - finding first space"); + } + + $secondSpace = strpos($versionInstalledStringComplete, ' ', $firstSpace + 1); + if ($secondSpace === false) { + die("Failed to understand version string $versionInstalledStringComplete - finding second space"); + } + + $versionInstalledString = substr($versionInstalledStringComplete, $firstSpace + 1, $secondSpace - $firstSpace - 1); + // echo "versionInstalledString is $versionInstalledString \n"; + + $versionToCompare = $im7Version; + if (substr($versionInstalledString, 0, 1) === '6') { + $versionToCompare = $testIm6Version; + } + + return version_compare($versionInstalledString, $versionToCompare); +} + +/** + * + * Compares the installed version of ImageMagick and returns true if the appropriate + * version is greater + * + * @param $testIm6Version + * @param $im7Version + * @return bool + */ +function isVersionGreaterEqual($testIm6Version, $im7Version) +{ + $versionCompare = version_compare_imagemagick($testIm6Version, $im7Version); + // echo "version compare for $testIm6Version, $im7Version is $versionCompare \n"; + + if ($versionCompare >= 0) { + return true; + } + + return false; +} + +/** + * On some systems, where the standard fonts aren't available, trying + * to draw any text fails as the ImageMagick default font is null. + * + * This function just find a 'sensible' font to use, either from the + * preferred list, or just the first one from queryFonts(). That 'probably' + * is the right thing to do, as it makes the tests more stable. + */ +function findDefaultFont() +{ + $knownFonts = + 'Courier', + 'Helvetica', + 'Times-Roman', + 'Liberation-Mono', + 'Utopia', + ; + + $fontList = \Imagick::queryFonts(); + + foreach ($knownFonts as $knownFont) { + + if (in_array($knownFont, $fontList, true) === true) { + return $knownFont; + } + } + + if (count($fontList) !== 0) { + return $fontList0; + } + + throw new \Exception("No fonts available on system, apparently."); +} + +// Find and set a font for the Imagick object +function setFontForImagick(\Imagick $imagick) +{ + $font = findDefaultFont(); + + $imagick->setFont($font); +} + +// Find and set a font for the ImagickDraw object +function setFontForImagickDraw(\ImagickDraw $imagickDraw) +{ + $font = findDefaultFont(); + + $imagickDraw->setFont($font); +} + +/** + * Checks that a named value exists in an array and it matches + * an expected value. + */ +function check_value(array $values, $name, $expected_value) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + $epsilon = 0.01; + + if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { + $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value"; + throw new \Exception($message); + } + + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; +} + + +/** + * Checks that a named value exists in an array and it matches + * one of a number of expected values. + * This function exists because the expected values for Kurtosis can + * change when the underlying maths changes: https://github.com/ImageMagick/ImageMagick/issues/6924 + */ +function check_value_posibilities(array $values, $name, array $expected_values) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + $epsilon = 0.01; + + foreach ($expected_values as $expected_value) { + if (($value > $expected_value - $epsilon) && ($value < $expected_value + $epsilon)) { + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; + return; + } + } + + $expected_string = implode(", ", $expected_values); + + $message = "Value for $name doesn't match expected possibilities. Expected one of: $expected_string, actual: $value"; + throw new \Exception($message); +} + + +function check_value_with_epsilon(array $values, $name, $expected_value, $epsilon) +{ + if (array_key_exists($name, $values) !== true) { + + $message = "Expected key '$name' not set. Array contains:\n"; + $message .= var_export($values, true); + + throw new \Exception($message); + } + + + $value = $values$name; + + if (($value < $expected_value - $epsilon) || ($value > $expected_value + $epsilon)) { + $message = "Value for $name doesn't match expected. Expected: $expected_value, actual: $value, epsilon = $epsilon"; + throw new \Exception($message); + } + + echo "Value for '$name' is $value which is close enough to expected $expected_value\n"; +} \ No newline at end of file
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/github_174.phpt
Changed
(renamed from imagick-3.7.0/tests/github_174.phpt)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/houghline_input_image.png
Changed
(renamed from imagick-3.7.0/tests/houghline_input_image.png)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/php.gif
Changed
(renamed from imagick-3.7.0/tests/php.gif)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/skipif.inc
Changed
(renamed from imagick-3.7.0/tests/skipif.inc)
View file
imagick-3.8.0.tgz/imagick-3.8.0/tests/skipprobefourier.inc
Changed
(renamed from imagick-3.7.0/tests/skipprobefourier.inc)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/Float32Info.php
Changed
(renamed from imagick-3.7.0/util/Float32Info.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/FloatInfo.php
Changed
(renamed from imagick-3.7.0/util/FloatInfo.php)
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/fixup_arginfo.php
Added
@@ -0,0 +1,156 @@ +<?php + +declare(strict_types = 1); + + +if ($argc !== 2) { + fwrite(STDERR, "usage php fixup_arginfo.php \$arginfo_filename\n"); + exit(-1); +} + +$filename = $argv1; + +$fixup_note = "file has been fixedup for different versions"; + +echo "Fixing $filename\n"; + +$input_lines = file($filename); + +foreach ($input_lines as $input_line) { + if (strpos($input_line, $fixup_note) !== false) { + echo "File has already been fixedup.\n"; + exit(0); + } +} + +$output_lines = ; + +$search = ; +$replace = ; + +$search = "#.*Stub hash: (.*) .*/#iu"; +$replace = "* Stub hash: regen with 'sh regen_arginfo.sh' \n* $fixup_note */"; + +$search = "#ZEND_ARG_OBJ_INFO\(0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; +$replace = " +#if MAGICKCORE_HDRI_ENABLE + ZEND_ARG_TYPE_INFO(0, $1, IS_DOUBLE, 0) +#else + ZEND_ARG_TYPE_INFO(0, $1, IS_LONG, 0) +#endif +"; + + +// ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) +// ZEND_ARG_INFO(pass_by_ref, name) + +$search = "#ZEND_ARG_TYPE_INFO\((\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO($1, $2, $3, $4) +#else + ZEND_ARG_INFO($1, $2) +#endif"; + +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), 0, (\w*), IMAGICK_QUANTUM_TYPE, 0\)#iu"; +$replace = " +#if MAGICKCORE_HDRI_ENABLE +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, 0, $2, IS_LONG, 0) +#endif +"; + + +//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) +#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX($1, $2, $3, $4, $5) +#else +ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ +$search = "#.*ZEND_ARG_TYPE_MASK\((\w|\|*), (\w|\|*), (\w|\|*), (\w\|\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_MASK($1, $2, $3, $4) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + +//ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, required_num_args, type) +//ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) + +$search = "#.*ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX\((\w|\|*), (\w|\|*), (\w|\|*), (\w|\|*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX($1, $2, $3, $4) +#else + ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) +$search = "#ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX\((\w*), (\w*), (\w*), (\w*), (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX($1, $2, $3, $4, $5) +#else +ZEND_BEGIN_ARG_INFO_EX($1, 0, $2, $3) +#endif +"; + +//ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) \ +$search = "#.*ZEND_ARG_OBJ_INFO\((\w*), (\w*), resource, (\w*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 +\tZEND_ARG_OBJ_INFO($1, $2, resource, $3) +#else +\tZEND_ARG_INFO($1, $2) +#endif +"; + +// ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, filename, IS_STRING, 1, "null") +$search = "#.*ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w*), (\w*), (\w\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE($1, $2, $3, $4, $5) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + +// ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, filename, "null") +$search = "#.*ZEND_ARG_INFO_WITH_DEFAULT_VALUE\((\w*), (\w*), (\w\"*)\)#iu"; +$replace = " +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_INFO_WITH_DEFAULT_VALUE($1, $2, $3) +#else + ZEND_ARG_INFO($1, $2) +#endif +"; + + + +//#if PHP_VERSION_ID >= 80000 +//ZEND_ARG_TYPE_MASK(0, files, MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_NULL, NULL) +//#else +// ZEND_ARG_INFO(0, files) +//#endif + + + +foreach ($input_lines as $input_line) { + $input_line = rtrim($input_line); + $input_line = preg_replace($search, $replace, $input_line); + + $output_lines = $input_line; +} + +file_put_contents($filename, implode("\n", $output_lines)); +echo "File has now been fixedup.\n";
View file
imagick-3.8.0.tgz/imagick-3.8.0/util/functions.php
Changed
(renamed from imagick-3.7.0/util/functions.php)
View file
imagick-3.7.0.tgz/package.xml -> imagick-3.8.0.tgz/package.xml
Changed
@@ -1,21 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> -<package packagerversion="1.10.12" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> +<package packagerversion="1.10.13" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>imagick</name> <channel>pecl.php.net</channel> <summary>Provides a wrapper to the ImageMagick library.</summary> <description>Imagick is a native php extension to create and modify images using the ImageMagick API. -This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.</description> +This extension requires ImageMagick version 6.5.3-10+ and PHP 5.6.0+.</description> <lead> <name>Dan Ackroyd</name> <user>danack</user> <email>danack@php.net</email> <active>yes</active> </lead> - <date>2022-01-11</date> - <time>15:23:47</time> + <lead> + <name>Jakub Zelenka</name> + <user>bukka</user> + <email>bukka@php.net</email> + <active>yes</active> + </lead> + <date>2025-04-10</date> + <time>17:09:23</time> <version> - <release>3.7.0</release> - <api>3.7.0</api> + <release>3.8.0</release> + <api>3.8.0</api> </version> <stability> <release>stable</release> @@ -23,8 +29,8 @@ </stability> <license uri="http://www.php.net/license">PHP License</license> <notes> -- Added: - * Imagick::COMPOSITE_SALIENCY_BLEND +- Fixes: + * Fix signedness formatting mistakes </notes> <contents> <dir name="/"> @@ -44,8 +50,10 @@ <file md5sum="5575a4c8819e6fcd16a5060d6f6d6b88" name="tests/010_importimagepixels.phpt" role="test" /> <file md5sum="f9a2b3ad703b8e7f5fc017d4ac51e444" name="tests/011_polygon.phpt" role="test" /> <file md5sum="058d0a08752790abf5a5050ea0fd0e98" name="tests/012-clone-separation.phpt" role="test" /> - <file md5sum="2ee0ff0876cf5de08eddac649f58ad9a" name="tests/013-read-filehandle.phpt" role="test" /> - <file md5sum="9bfdc24c7d181c70300cbcfb75ba02aa" name="tests/014-setresourcelimit.phpt" role="test" /> + <file md5sum="22b0b4b6a03246ab701b67fab720d116" name="tests/013-read-filehandle.phpt" role="test" /> + <file md5sum="b5ee2b4af4a54ea2253cd9824cd6cdd2" name="tests/013-read-filehandle-memory-stream.phpt" role="test" /> + <file md5sum="c11ebb2408313fbfe58c2ea22554df1d" name="tests/013-read-filehandle-file-stream.phpt" role="test" /> + <file md5sum="276ae595ebc53c5ad8f2962388aba5ba" name="tests/014-setresourcelimit.phpt" role="test" /> <file md5sum="feb911d00b9d2018b43f65d62657016a" name="tests/015-imagickdrawsetresolution.phpt" role="test" /> <file md5sum="2d811a448bdd4e7c7b906db94cc518f8" name="tests/016-static-methods.phpt" role="test" /> <file md5sum="59e0bde93ae3de720dbedc80bd23933a" name="tests/017-clear-destroy.phpt" role="test" /> @@ -62,7 +70,7 @@ <file md5sum="564f3d103027ffba8c3e983252fe502a" name="tests/028_Imagick_adaptiveSharpenImage_basic.phpt" role="test" /> <file md5sum="9ef2c2c0f19e2ecf46a36080a9c2c4ba" name="tests/029_Imagick_adaptiveBlurImage_basic.phpt" role="test" /> <file md5sum="ab362477502d816f271f09598b1c1fe2" name="tests/030_Imagick_adaptiveThresholdImage_basic.phpt" role="test" /> - <file md5sum="130d4ea7fd98f6e7301392b210ed6238" name="tests/031_Imagick_affineTransformImage_basic.phpt" role="test" /> + <file md5sum="b302e3a53a3dbc93d87c14b1b1b3cb66" name="tests/031_Imagick_affineTransformImage_basic.phpt" role="test" /> <file md5sum="e46101e28b5409950873aec6ba7b9a32" name="tests/032_Imagick_addNoiseImage_basic.phpt" role="test" /> <file md5sum="5df1d44e69b54821f87ab1cb9715dce3" name="tests/033_Imagick_autoLevelImage_basic.phpt" role="test" /> <file md5sum="ca40b80eb5e50f9937f927ac05fa110f" name="tests/034_Imagick_annotateImage_basic.phpt" role="test" /> @@ -74,7 +82,8 @@ <file md5sum="5bf72f9179d7b3bb7e976b2ee0e88641" name="tests/039_Imagick_borderImage_im7.phpt" role="test" /> <file md5sum="f7650055fa622ff57517fe26db2e40f3" name="tests/040_Imagick_charcoalImage_basic.phpt" role="test" /> <file md5sum="ab034867bc3ed969c215c359f785dac3" name="tests/041_Imagick_chopImage_basic.phpt" role="test" /> - <file md5sum="6155d928fa62874282bab995cca0e9ad" name="tests/042_Imagick_clutImage_basic.phpt" role="test" /> + <file md5sum="e1f496a53bd6288b8404b8070da3750c" name="tests/042_Imagick_clutImage_basic.phpt" role="test" /> + <file md5sum="ae6e05bf5ab8d57b653947de42a80f30" name="tests/042_Imagick_clutImage_im7.phpt" role="test" /> <file md5sum="bb569e19869bc4027bd6fa203cdf306e" name="tests/043_Imagick_colorizeImage_basic.phpt" role="test" /> <file md5sum="ed91b225c80fcd75ce63055bbe4a616d" name="tests/044_Imagick_colorMatrixImage_basic.phpt" role="test" /> <file md5sum="de86d54e462c61e691d31ef8e08c96ba" name="tests/045_Imagick_compositeImage_basic.phpt" role="test" /> @@ -125,7 +134,7 @@ <file md5sum="6cf73696f373b8b28594efce9550e093" name="tests/089_Imagick_medianFilterImage_basic.phpt" role="test" /> <file md5sum="7357f18a08692acd51b6ff8a5fae93bf" name="tests/090_Imagick_magnifyImage_basic.phpt" role="test" /> <file md5sum="43d2943e63c01d74adad0375fcdb5133" name="tests/091_Imagick_linearStretchImage_basic.phpt" role="test" /> - <file md5sum="5a720f34ee6ec948f796cca08ddfdf42" name="tests/092_Imagick_mergeImageLayers_basic.phpt" role="test" /> + <file md5sum="71a6dfbf58b1e0a97c67c697402ac0aa" name="tests/092_Imagick_mergeImageLayers_basic.phpt" role="test" /> <file md5sum="238b65c0fa2ef8439cd71d458f222943" name="tests/093_Imagick_modulateImage_basic.phpt" role="test" /> <file md5sum="7ae4cbcc2388ac3e4a98ae9a0d97b897" name="tests/094_Imagick_motionBlurImage_basic.phpt" role="test" /> <file md5sum="fd975fcf80f318926f4d519fdb17977d" name="tests/095_Imagick_normalizeImage_basic.phpt" role="test" /> @@ -176,7 +185,7 @@ <file md5sum="4a377c795ae035b9a736241c234b3c31" name="tests/143_Imagick_spreadImage_basic.phpt" role="test" /> <file md5sum="8c873a32d61a2cd2428f13d402daa945" name="tests/143_Imagick_spreadImageWithMethod_basic.phpt" role="test" /> <file md5sum="9263c00097d1dbd8abceb182cc72e92e" name="tests/144_Imagick_spliceImage_basic.phpt" role="test" /> - <file md5sum="b5334176264be1382cc86badff178846" name="tests/145_imagickkernel_coverage.phpt" role="test" /> + <file md5sum="86b9d786d8d097f8f038a38186e51564" name="tests/145_imagickkernel_coverage.phpt" role="test" /> <file md5sum="4f76d53aa43b408be7dcf58e74129d3f" name="tests/149_Imagick_sparseColorImage.phpt" role="test" /> <file md5sum="329b3f90c0a76f3ae71172d83eb9064a" name="tests/150_Imagick_setregistry.phpt" role="test" /> <file md5sum="f4a0d4208e7c5715acdf9c8ca4aaeeb6" name="tests/151_Imagick_subImageMatch_basic.phpt" role="test" /> @@ -270,26 +279,26 @@ <file md5sum="584b77d3e70004610be1fd3697f52654" name="tests/243_Tutorial_svgExample_basic.phpt" role="test" /> <file md5sum="8253d7110ac4ad3c8158516376083628" name="tests/244_Tutorial_psychedelicFontGif_basic.phpt" role="test" /> <file md5sum="8d2952d75ddc1bd7265dd2aa96312acc" name="tests/245_Tutorial_screenEmbed_basic.phpt" role="test" /> - <file md5sum="72e06e279f77daddb30315092ab74289" name="tests/246_antialias_image.phpt" role="test" /> + <file md5sum="734fc305857c03dd56b198c82b3286ae" name="tests/246_antialias_image.phpt" role="test" /> <file md5sum="4e7d524afc4cd2c32406ece1816a1e3a" name="tests/247_ImagickPixelIterator_construct_basic.phpt" role="test" /> <file md5sum="ee3b287a2c34fdb6b2ce41b112b2611d" name="tests/248_ImagickPixelIterator_clear_basic.phpt" role="test" /> <file md5sum="c47640246b86f53e414c3c22748c16cc" name="tests/249_ImagickPixelIterator_getNextIteratorRow_basic.phpt" role="test" /> <file md5sum="610d1633169d9aad141221b376f93d7d" name="tests/250_ImagickPixelIterator_resetIterator_basic.phpt" role="test" /> <file md5sum="b3b6c4982de222a0b683ec46eee74a4a" name="tests/251_ImagickPixelIterator_setIteratorRow_basic.phpt" role="test" /> - <file md5sum="4e7d524afc4cd2c32406ece1816a1e3a" name="tests/252_ImagickPixelIterator_construct_basic.phpt" role="test" /> + <file md5sum="58f969ee4d5879475c211c936577fcfb" name="tests/252_ImagickPixelIterator_construct_basic.phpt" role="test" /> <file md5sum="709ba0815ab47bb2dc967179e2d0de93" name="tests/064_cropThumbNailImage.phpt" role="test" /> <file md5sum="ebea7ebf0f95aaf25fa401644f5829a1" name="tests/253_getHdri.phpt" role="test" /> - <file md5sum="956182e472896cef88789e9decbaf61d" name="tests/254_getConfigureOptions.phpt" role="test" /> + <file md5sum="5a82388e09077e9151c48d683726cb49" name="tests/254_getConfigureOptions.phpt" role="test" /> <file md5sum="95dc4f184d99da28296768261884bac0" name="tests/255_getFeatures.phpt" role="test" /> <file md5sum="fd4fed6a4d80bce72088047f821b2dc7" name="tests/256_Imagick_exportImagePixels_basic.phpt" role="test" /> - <file md5sum="b9c43a5f6ee19f7142f2c481429b07a1" name="tests/257_Imagick_setImageChannelMask_basic.phpt" role="test" /> + <file md5sum="a968eeade13c74c55872edbfc482bc42" name="tests/257_Imagick_setImageChannelMask_basic.phpt" role="test" /> <file md5sum="d1d1bfc0945e2347268f5b4b607c3235" name="tests/258_Imagick_evaluateImages_basic.phpt" role="test" /> <file md5sum="76d35ace1a27c6001d909af15b79ada8" name="tests/259_Imagick_colorPoints_basic.phpt" role="test" /> <file md5sum="9cf922a27cf0aeecab3d0c51388031dc" name="tests/260_localContrastImage.phpt" role="test" /> <file md5sum="dd0c76af37fa3f8d4d422ae25450becc" name="tests/261_compositeImageGravity.phpt" role="test" /> <file md5sum="51a669efe49af023d00e77cb094a6b15" name="tests/262_autoOrient.phpt" role="test" /> - <file md5sum="5080e13a369db4e2042a83827dbcda9d" name="tests/263_autoGammaImage.phpt" role="test" /> - <file md5sum="df636278b41cccfccbdf3dbf5e9426f4" name="tests/264_ImagickDraw_getTextDirection_basic.phpt" role="test" /> + <file md5sum="ee1c0da6a3a96aa3eec923789d01f8ba" name="tests/263_autoGammaImage.phpt" role="test" /> + <file md5sum="3d9fcdd3ff03fcef1c5af679a44f5405" name="tests/264_ImagickDraw_getTextDirection_basic.phpt" role="test" /> <file md5sum="1e61166e6907212a5175b9c647838f1a" name="tests/265_ImagickDraw_getOpacity_basic.phpt" role="test" /> <file md5sum="57d89597b88c88e430364c049b38d718" name="tests/266_ImagickDraw_getFontResolution_basic.phpt" role="test" /> <file md5sum="d1ec44bed69eacde2db52cbf89befc21" name="tests/267_ImagickDraw_getBorderColor_basic.phpt" role="test" /> @@ -299,14 +308,14 @@ <file md5sum="90af42a2b834e318d762b286cfc6ff65" name="tests/271_imagick_constants.phpt" role="test" /> <file md5sum="93d7b4b65df7e0f398f8ffb89c3ded29" name="tests/272_imagick_identifyimagetype.phpt" role="test" /> <file md5sum="5d2e90aac7782db6c543be3e4231dc8b" name="tests/273_imagick_falsyimage.phpt" role="test" /> - <file md5sum="6a7b5e9463e8c786a5dec8482d7efebd" name="tests/274_imagick_setImageAlpha.phpt" role="test" /> + <file md5sum="52b20af8f3fd002bdf017da966fffba5" name="tests/274_imagick_setImageAlpha.phpt" role="test" /> <file md5sum="f5fc0eb6d23f304969c26c9db7ee0014" name="tests/275_ImagickPixel_unitializedObjects.phpt" role="test" /> <file md5sum="9391ee397852444bc877f515c4fc82fa" name="tests/276_Imagick_artifacts.phpt" role="test" /> <file md5sum="ae0ec59997765d5d595ef1420b2786b8" name="tests/277_Imagick_colorDecisionListImage.phpt" role="test" /> - <file md5sum="d4c9b456de56ce6d810c99a28ae2266d" name="tests/278_Imagick_optimaze_gif.phpt" role="test" /> + <file md5sum="b067030838b39c824559f0798cd3def0" name="tests/278_Imagick_optimaze_gif.phpt" role="test" /> <file md5sum="ac97eda781d3df04a02b1ee82d7856d6" name="tests/279_ImagickDraw_setTextInterlineSpacing.phpt" role="test" /> <file md5sum="18cc434cd9dbdc14c36b617365de3e70" name="tests/280_imagickkernel_exception_invalid_origin.phpt" role="test" /> - <file md5sum="916610299aaa04b46d64a23c5db0b8f4" name="tests/281_imagick_houghLineImage_basic.phpt" role="test" /> + <file md5sum="39bd69a5753144f5f555341843117f68" name="tests/281_imagick_houghLineImage_basic.phpt" role="test" /> <file md5sum="a5e414c5a2367791a80a14d0307a7a81" name="tests/281_ini_settings_default.phpt" role="test" /> <file md5sum="7ac90c9793ce913fbeb5dfeea9637c8c" name="tests/282_ini_settings_set_falsy_string.phpt" role="test" /> <file md5sum="685f4dac48116c82d40a0a2fe9b69e44" name="tests/283_ini_settings_set_falsy_zero.phpt" role="test" /> @@ -315,7 +324,7 @@ <file md5sum="70ed9b2e2dc9ded36d61e08e3f1fdca9" name="tests/286_Imagick_setMask_basic.phpt" role="test" /> <file md5sum="fd6bb938349bac41405f545b4efc8e54" name="tests/287_Imagick_GetImageChannelRange_basic.phpt" role="test" /> <file md5sum="fa497613d70bd4af8120781286ce3b98" name="tests/288_imagick_prevent_zero_size_images.phpt" role="test" /> - <file md5sum="966ebdc7725a32671742db2c2a24d828" name="tests/289_Imagick_setImageMask_basic.phpt" role="test" /> + <file md5sum="7cfeb135a9ea25a1387ecd4cfc87a421" name="tests/289_Imagick_setImageMask_basic.phpt" role="test" /> <file md5sum="032fb0d3e18f905f83fd437c561f2d2e" name="tests/290_imagick_profileimage.phpt" role="test" /> <file md5sum="16a0c4b5d0515629eadd173b2073214e" name="tests/291_reflection.phpt" role="test" /> <file md5sum="b7f187644872a160be781648834091a4" name="tests/292_index_iterator.phpt" role="test" /> @@ -340,7 +349,7 @@ <file md5sum="34681d4ffb3d1fa3c9c037dafdec9e12" name="tests/312_Imagick_colorThresholdImage.phpt" role="test" /> <file md5sum="a08bcf706a3ab0b23127bd8c7b0f15be" name="tests/314_Imagick_getBackgroundColor.phpt" role="test" /> <file md5sum="12abf821306dd1584da8de28b046dbb2" name="tests/315_Imagick_getImageArtifacts.phpt" role="test" /> - <file md5sum="7f62b0623c0328b2159849588721cbc8" name="tests/316_Imagick_getImageKurtosis.phpt" role="test" /> + <file md5sum="1cd7ed4bea889b359cecbde3229ee014" name="tests/316_Imagick_getImageKurtosis.phpt" role="test" /> <file md5sum="9dfe1d45cc7659a368b7f53c65ccaf0f" name="tests/317_Imagick_getImageMean.phpt" role="test" /> <file md5sum="58ea6703df1f273e930254440ec10b7c" name="tests/318_Imagick_getImageRange.phpt" role="test" /> <file md5sum="1309063dc6420da68aa246fe6f11af05" name="tests/319_Imagick_getInterpolateMethod.phpt" role="test" /> @@ -348,11 +357,13 @@ <file md5sum="30434386321de90c7ddae519662309ad" name="tests/321_Imagick_getOrientation.phpt" role="test" /> <file md5sum="69e82ca237635877c1d95f02bc3f025c" name="tests/322_Imagick_getResolution.phpt" role="test" /> <file md5sum="9e8b7c236c980c5840b9def9fd912736" name="tests/323_Imagick_getType.phpt" role="test" /> - <file md5sum="a2383b3e9d7df5d85d25a0ccf583db50" name="tests/324_Imagick_polynomialImage.phpt" role="test" /> - <file md5sum="8e12a6ad4de34823058127a9e592a176" name="tests/325_Imagick_setDepth.phpt" role="test" /> + <file md5sum="38c244de709e5a94e9440c05c9af2605" name="tests/324_Imagick_polynomialImage.phpt" role="test" /> + <file md5sum="a40be1f48254f9ea13d326699ae4f5a2" name="tests/325_Imagick_setDepth.phpt" role="test" /> <file md5sum="6aef8ed00d4ebbef680f1bddd8ce05dc" name="tests/326_Imagick_setExtract.phpt" role="test" /> <file md5sum="b08069dd3a7e66b4b81325f0cbfabd0f" name="tests/327_Imagick_polaroidImage_basic.phpt" role="test" /> <file md5sum="6037c71db1fb1b7c050494e4e8b8dbe4" name="tests/328_Imagick_polaroidImageWithTextAndMethod_basic.phpt" role="test" /> + <file md5sum="89e3972a5dbbe89ff58eea1f94b2c5e6" name="tests/329_imagick_getImageBlob_empty.phpt" role="test" /> + <file md5sum="ddcdb3e725a8bf9828500fa9dcc8eb54" name="tests/330_Imagick_newImage.phpt" role="test" /> <file md5sum="7dd644c7b96b6591f83a46bd62fe03c6" name="tests/bug20636.phpt" role="test" /> <file md5sum="44f0d734dab227610bfeae5d0f9266e3" name="tests/bug21229.phpt" role="test" /> <file md5sum="10d5433d2c44583c0775dc56d0e39784" name="tests/bug59378.phpt" role="test" /> @@ -363,7 +374,7 @@ <file md5sum="2b237392d0a7e710082b1ebebb6d6e5f" name="tests/bug_72226.phpt" role="test" /> <file md5sum="5745f92524e319f2983778409d165be8" name="tests/bug_73840.phpt" role="test" /> <file md5sum="f69a3c9a9b358fc92bb6eefccad3722b" name="tests/bug81235.phpt" role="test" /> - <file md5sum="4979d96fd288c5a0daadd16c5500d447" name="tests/functions.inc" role="test" /> + <file md5sum="2f035178707fa1da08e542ce7857db0b" name="tests/functions.inc" role="test" /> <file md5sum="c3b92b06fb138ebed58000ed01f32eef" name="tests/github_174.phpt" role="test" /> <file md5sum="0559726d3af71e62a47417f480a37665" name="tests/houghline_input_image.png" role="test" /> <file md5sum="bc90e473c420305bb99f49acadc72484" name="tests/Biter_500.jpg" role="test" /> @@ -375,51 +386,51 @@ <file md5sum="d323f8286c5045f599098fade7c22f2a" name="util/Float32Info.php" role="test" /> <file md5sum="00df752d5bf8f1f4b79448edb05d9990" name="util/FloatInfo.php" role="test" /> <file md5sum="4f19b77ff6c3c2c31034a0aab1585616" name="util/functions.php" role="test" /> - <file md5sum="df516b68d529c7a3d1bd1292d8b630ba" name="util/fixup_arginfo.php" role="src" /> - <file md5sum="496f815c956afb08245957b3432e7a1c" name="config.m4" role="src" /> + <file md5sum="7acaeeae91ca9be7b5616474e55e4647" name="util/fixup_arginfo.php" role="src" /> + <file md5sum="90b24b5065eb38125eeb884c18eecaae" name="config.m4" role="src" /> <file md5sum="78248656dd502a5f2e379114d7ab69f9" name="imagemagick.m4" role="src" /> <file md5sum="e3f57381df318f416209380691933e9c" name="config.w32" role="src" /> <file md5sum="6077035e65e0b0bbe5a28917282e26b2" name="CREDITS" role="doc" />
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.