Skip to content

Commit

Permalink
Merge branch '3.7.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Danack committed Jan 30, 2022
2 parents 62ce326 + cc3ecab commit 661405a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Unreleased
- Added:
* Imagick::COMPOSITE_SALIENCY_BLEND

3.7.0RC1
- Added:
* function Imagick::deleteOption(string $option): bool {}
Expand Down Expand Up @@ -33,6 +37,7 @@
* 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.
Expand Down
5 changes: 5 additions & 0 deletions imagick_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,11 @@ void php_imagick_initialize_constants(TSRMLS_D)
IMAGICK_REGISTER_CONST_LONG("COMPOSITE_RMSE", RMSECompositeOp);
#endif

#if MagickLibVersion >= 0x711
IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SALIENCY_BLEND", SaliencyBlendCompositeOp);
IMAGICK_REGISTER_CONST_LONG("COMPOSITE_SEAMLESS_BLEND", SeamlessBlendCompositeOp);
#endif

IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_FRAME", FrameMode);
IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_UNFRAME", UnframeMode);
IMAGICK_REGISTER_CONST_LONG("MONTAGEMODE_CONCATENATE", ConcatenateMode);
Expand Down
5 changes: 3 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.
* 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.
Expand Down Expand Up @@ -251,7 +252,7 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.
<file name="141_Imagick_sketchImage_basic.phpt" role="test" />
<file name="142_Imagick_solarizeImage_basic.phpt" role="test" />
<file name="143_Imagick_spreadImage_basic.phpt" role="test" />
<file name="143_Imagick_spreadImageWithMethod_basic.phpt" role="test" />
<file name="143_Imagick_spreadImageWithMethod_basic.phpt" role="test" />
<file name="144_Imagick_spliceImage_basic.phpt" role="test" />
<file name="145_imagickkernel_coverage.phpt" role="test" />
<file name="149_Imagick_sparseColorImage.phpt" role="test" />
Expand All @@ -273,7 +274,7 @@ This extension requires ImageMagick version 6.5.3-10+ and PHP 5.4.0+.
<file name="164_Imagick_trimImage_basic.phpt" role="test" />
<file name="165_Imagick_unsharpMaskImage_basic.phpt" role="test" />
<file name="166_Imagick_waveImage_basic.phpt" role="test" />
<file name="166_Imagick_waveImageWithMethod_basic.phpt" />
<file name="166_Imagick_waveImageWithMethod_basic.phpt" role="test" />
<file name="167_Imagick_vignetteImage_basic.phpt" role="test" />
<file name="168_Imagick_whiteThresholdImage_basic.phpt" role="test" />
<file name="169_ImagickPixel_construct_basic.phpt" role="test" />
Expand Down
12 changes: 6 additions & 6 deletions tests/236_Imagick_identify_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ $imagick->newPseudoImage(640, 480, "magick:logo");
$imagick->setImageFormat('png');
$data = $imagick->identifyimage();

echo "format: " . $data["format"] . "\n";
echo "units: " . $data["units"] . "\n";
echo "type: " . $data["type"] . "\n";
echo "format: " . strtolower($data["format"]) . "\n";
echo "units: " . strtolower($data["units"]) . "\n";
echo "type: " . strtolower($data["type"]) . "\n";

if (array_key_exists('geometry', $data)) {
$geometry = $data['geometry'];
Expand All @@ -34,7 +34,7 @@ var_dump($data);

?>
--EXPECTF--
format: PNG (Portable Network Graphics)
units: Undefined
type: Palette
format: png (portable network graphics)
units: undefined
type: palette
Image geometry 640x480
18 changes: 9 additions & 9 deletions util/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,22 @@ function get_epsilon_for_off_by_half_errors()
{
// These could be defined better...
$epsilon_values_for_non_hdri = [
255 => (1 / (pow(2, 8) - 1)) + 0.0000000000001,
65535 => (1 / (pow(2, 16) - 1)) + 0.0000000000001,
16777215 => (1 / (pow(2, 24) - 1) ) + 0.0000000000001,
4294967295 => (1 / (pow(2, 32) - 1)) + 0.0000000000001,
'255' => (1 / (pow(2, 8) - 1)) + 0.0000000000001,
'65535' => (1 / (pow(2, 16) - 1)) + 0.0000000000001,
'16777215' => (1 / (pow(2, 24) - 1) ) + 0.0000000000001,
'4294967295' => (1 / (pow(2, 32) - 1)) + 0.0000000000001,
];

// These could definitely be defined better...
$epsilon_values_for_hdri = [
255 => 0.0000000000001,
65535 => 0.0000000000001,
16777215 => 0.0000000000001,
4294967295 => 0.0000000000001
'255' => 0.0000000000001,
'65535' => 0.0000000000001,
'16777215' => 0.0000000000001,
'4294967295' => 0.0000000000001
];

if (Imagick::getHdriEnabled() === false) {
$quantum = Imagick::getQuantum();
$quantum = (string)Imagick::getQuantum();
if (array_key_exists($quantum, $epsilon_values_for_non_hdri) !== true) {
throw new Exception(
"Quantum values is $quantum which is not any of (2^(8|16|24|32)) - 1. Please report this as a bug."
Expand Down

0 comments on commit 661405a

Please sign in to comment.