| Server IP : 170.10.162.208 / Your IP : 216.73.216.181 Web Server : LiteSpeed System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64 User : deltahospital ( 1806) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/deltahospital/.cagefs/tmp/ |
Upload File : |
<?php
namespace HexFloat;
// Mirrored from https://github.com/Danack/HexFloat
class Float32Info
{
//Sign bit: 1 bit
private $sign;
//Exponent: 11 bits
private $exponent;
//Mantissa precision: 53 bits (52 explicitly stored)
private $mantissa;
public function __construct(
$sign,
$exponent,
$mantissa
) {
// TODO - check lengths
$this->sign = $sign;
$this->exponent = $exponent;
$this->mantissa = $mantissa;
}
public function getSign()
{
return $this->sign;
}
public function getExponent()
{
return $this->exponent;
}
public function getMantissa()
{
return $this->mantissa;
}
}
<?php
declare(strict_types = 1);
if ($argc !== 2) {
fwrite(STDERR, "usage php fixup_arginfo.php \$arginfo_filename\n");
exit(-1);
}
$filename = $argv[1];
$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";
<?php
namespace HexFloat;
// Mirrored from https://github.com/Danack/HexFloat
class FloatInfo
{
//Sign bit: 1 bit
private $sign;
//Exponent: 11 bits
private $exponent;
//Mantissa precision: 53 bits (52 explicitly stored)
private $mantissa;
public function __construct(
$sign,
$exponent,
$mantissa
) {
// TODO - check lengths
$this->sign = $sign;
$this->exponent = $exponent;
$this->mantissa = $mantissa;
}
public function getSign()
{
return $this->sign;
}
public function getExponent()
{
return $this->exponent;
}
public function getMantissa()
{
return $this->mantissa;
}
}
<?php
// Mirrored from https://github.com/Danack/HexFloat
require_once __DIR__ . "/FloatInfo.php";
require_once __DIR__ . "/Float32Info.php";
use HexFloat\FloatInfo;
use HexFloat\Float32Info;
/**
* Returns a string containing a hexadecimal representation of the given float,
* using 64 bits of info
*
* @param float $number
* @return string
*/
function floathex(float $number)
{
return strrev(unpack('h*', pack('d', $number))[1]);
}
/**
* Returns a string containing a hexadecimal representation of the given float,
* using 32 bits of info
*
* @param float $number
* @return string
*/
function floathex32(float $num)
{
return strrev(unpack('h*', pack('f', $num))[1]);
}
/**
* Convert a floating point number to a FloatInfo object,
* which contains string representations of the float's sign,
* exponent and mantissa
* @param float $num
* @return FloatInfo
*/
function float_info(float $num)
{
$float64 = floathex($num);
//Sign bit: 1 bit
//Exponent: 11 bits
//Significand precision: 53 bits (52 explicitly stored)
$chars = str_split($float64);
// 3 bits from this
$byte1 = hexdec($chars[0]);
// 4 bits from this
$byte2 = hexdec($chars[1]);
// 1 bit from this
$byte3 = hexdec($chars[2]);
$sign = '0';
if ($byte1 >= 8) {
$sign = '1';
}
$exponentString = substr($float64, 0, 3);
$exponentValue = hexdec($exponentString) & 0x7ff;
$exponent = sprintf("%b", $exponentValue);
$exponent = str_pad($exponent, 11, '0', STR_PAD_LEFT);
$mantissa = substr($float64, 2);
$mantissa = hexdec($mantissa) & 0xfffffffffffff;
$mantissa = sprintf("%b", $mantissa);
$mantissa = str_pad($mantissa, 52, '0', STR_PAD_LEFT);
return new FloatInfo(
$sign,
$exponent,
$mantissa
);
}
/**
* Convert a floating point number to a Float32Info object,
* which contains string representations of the float's sign,
* exponent and mantissa
*
* @param float $num
* @return Float32Info
*/
function float_info_32(float $num)
{
$float32 = floathex32($num);
$chars = str_split($float32);
// 3 bits from this
$byte1 = hexdec($chars[0]);
// 4 bits from this
$byte2 = hexdec($chars[1]);
// 1 bit from this
$byte3 = hexdec($chars[2]);
$sign = '0';
if ($byte1 >= 8) {
$sign = '1';
}
$exponent3Bits = ($byte1 & 0x7);
$exponent4Bits = $byte2;
$exponent1Bit = ($byte3 & 0x8) >> 3;
$exponent = ($exponent3Bits << 5) | ($exponent4Bits << 1) | $exponent1Bit;
$exponent = sprintf("%b", $exponent);
$exponent = str_pad($exponent, 8, '0', STR_PAD_LEFT);
$mantissa = substr($float32, 2, 6);
$mantissa = hexdec($mantissa) & 0x7fffff;
$mantissa = sprintf("%b", $mantissa);
$mantissa = str_pad($mantissa, 23, '0', STR_PAD_LEFT);
return new Float32Info(
$sign,
$exponent,
$mantissa
);
}
/**
* Produce a debug string that shows the Sign, Exponent and Mantissa for
* two floating point numbers, using 64bit precision
*
*
* @param float $value1
* @param float $value2
* @return string
*
* Example result
* ┌──────┬─────────────┬──────────────────────────────────────────────────────┐
* │ Sign │ Exponent │ Mantissa │
* │ 0 │ 01111111011 │ 1001100110011001100110011001100110011001100110011010 │
* │ 0 │ 10000011001 │ 0111110101111000010000000100000000000000000000000000 │
* └──────┴─────────────┴──────────────────────────────────────────────────────┘
*
*/
function float_compare(float $value1, float $value2)
{
$float_info_1 = float_info($value1);
$float_info_2 = float_info($value2);
//Sign bit: 1 bit
//Exponent: 11 bits
//Significand precision: 53 bits (52 explicitly stored)
$output = "┌──────┬─────────────┬──────────────────────────────────────────────────────┐\n";
$output .= "│ Sign │ Exponent │ Mantissa │\n";
$format_string = "│ %s │ %s │ %s │\n";
$output .= sprintf($format_string, $float_info_1->getSign(), $float_info_1->getExponent(), $float_info_1->getMantissa());
$output .= sprintf($format_string, $float_info_2->getSign(), $float_info_2->getExponent(), $float_info_2->getMantissa());
$output .= "└──────┴─────────────┴──────────────────────────────────────────────────────┘\n";
return $output;
}
/**
* Produce a debug string that shows the Sign, Exponent and Mantissa for
* two floating point numbers, using 32bit precision
*
* @param float $value1
* @param float $value2
* @return string
*
* Example result
* ┌──────┬──────────┬─────────────────────────┐
* │ Sign │ Exponent │ Mantissa │
* │ 0 │ 01111011 │ 10011001100110011001101 │
* │ 0 │ 10011001 │ 01111101011110000100000 │
* └──────┴──────────┴─────────────────────────┘
*
*/
function float_compare_32(float $value1, float $value2)
{
$float_info_1 = float_info_32($value1);
$float_info_2 = float_info_32($value2);
$output = "┌──────┬──────────┬─────────────────────────┐\n";
$output .= "│ Sign │ Exponent │ Mantissa │\n";
$format_string = "│ %s │ %s │ %s │\n";
$output .= sprintf($format_string, $float_info_1->getSign(), $float_info_1->getExponent(), $float_info_1->getMantissa());
$output .= sprintf($format_string, $float_info_2->getSign(), $float_info_2->getExponent(), $float_info_2->getMantissa());
$output .= "└──────┴──────────┴─────────────────────────┘\n";
return $output;
}
/**
* So. One of the disadvantages of non-HDRI compiled Image Magick
* is that it can't accurately represent a '50%' color accurately.
*
* For example, if ImageMagick is compiled with 16bit color depth
* then the two closest colors to midpoint are:
* 32767 / 65535 = 0.5 - (1 / (2 ^ 17)) = 0.499992370...
* or
* 32768 / 65535 = 0.5 + (1 / (2 ^ 17)) = 0.50000762951
*
* Either way there is going to be 'error' of
* 0.00000762939453125
*
* The problem is even worse when ImageMagick is compiled with 8-bit
* numbers (though this really shouldn't be used any more) and the
* error would be 0.001953125
*
*/
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,
];
// These could definitely be defined better...
$epsilon_values_for_hdri = [
'255' => 0.0000000000001,
'65535' => 0.0000000000001,
'16777215' => 0.0000000000001,
'4294967295' => 0.0000000000001
];
if (Imagick::getHdriEnabled() === false) {
$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."
);
}
return $epsilon_values_for_non_hdri[$quantum];
}
$quantum = Imagick::getQuantum();
if (array_key_exists($quantum, $epsilon_values_for_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."
);
}
return $epsilon_values_for_hdri[$quantum];
}--TEST--
Test Imagick, deskewImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
checkFormatPresent('jpg');
?>
--FILE--
<?php
$threshold = 0.5;
function deskewImage($threshold) {
$imagick = $imagick = new \Imagick();
$imagick->newPseudoImage(640, 480, "magick:logo");
$deskewImagick = clone $imagick;
//This is the only thing required for deskewing.
$deskewImagick->deskewImage($threshold);
//The rest of this example is to make the result obvious - because
//otherwise the result is not obvious.
$trim = 9;
$deskewImagick->cropImage($deskewImagick->getImageWidth() - $trim, $deskewImagick->getImageHeight(), $trim, 0);
$imagick->cropImage($imagick->getImageWidth() - $trim, $imagick->getImageHeight(), $trim, 0);
$deskewImagick->resizeimage($deskewImagick->getImageWidth() / 2, $deskewImagick->getImageHeight() / 2, \Imagick::FILTER_LANCZOS, 1);
$imagick->resizeimage(
(int)($imagick->getImageWidth() / 2),
(int)($imagick->getImageHeight() / 2),
\Imagick::FILTER_LANCZOS,
1
);
$newCanvas = new \Imagick();
$newCanvas->newimage($imagick->getImageWidth() + $deskewImagick->getImageWidth() + 20, $imagick->getImageHeight(), 'red', 'jpg');
$newCanvas->compositeimage($imagick, \Imagick::COMPOSITE_COPY, 5, 0);
$newCanvas->compositeimage($deskewImagick, \Imagick::COMPOSITE_COPY, $imagick->getImageWidth() + 10, 0);
$bytes = $newCanvas->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
}
deskewImage($threshold) ;
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Imagick::__construct false
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
try {
$imagick = new Imagick(false);
}
catch (\ImagickException $ie) {
echo $ie->getMessage()."\n";
}
?>
--EXPECTF--
Constructor shouldn't be called with a boolean as the filename--TEST--
Test ImagickDraw, setStrokeWidth
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$backgroundColor = 'rgb(225, 225, 225)';
$strokeColor = 'rgb(0, 0, 0)';
$fillColor = 'DodgerBlue2';
function setStrokeWidth($strokeColor, $fillColor, $backgroundColor) {
$draw = new \ImagickDraw();
$draw->setStrokeWidth(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->line(100, 100, 400, 145);
$draw->rectangle(100, 200, 225, 350);
$draw->setStrokeWidth(5);
$draw->line(100, 120, 400, 165);
$draw->rectangle(275, 200, 400, 350);
$image = new \Imagick();
$image->newImage(500, 400, $backgroundColor);
$image->setImageFormat("png");
$image->drawImage($draw);
$bytes = $image->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
}
setStrokeWidth($strokeColor, $fillColor, $backgroundColor) ;
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Test ImagickDraw, setTextUnderColor
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
require_once(dirname(__FILE__) . '/functions.inc');
$backgroundColor = 'rgb(225, 225, 225)';
$strokeColor = 'rgb(0, 0, 0)';
$fillColor = 'DodgerBlue2';
$textUnderColor = 'DeepPink2';
function setTextUnderColor($strokeColor, $fillColor, $backgroundColor, $textUnderColor) {
$draw = new \ImagickDraw();
setFontForImagickDraw($draw);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->setFontSize(72);
$draw->annotation(50, 75, "Lorem Ipsum!");
$draw->setTextUnderColor($textUnderColor);
$draw->annotation(50, 175, "Lorem Ipsum!");
$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.";}
}
setTextUnderColor($strokeColor, $fillColor, $backgroundColor, $textUnderColor) ;
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Test ImagickPixelIterator, resetIterator
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
function resetIterator() {
$imagick = new \Imagick();
$imagick->newPseudoImage(640, 480, "magick:logo");
$imageIterator = $imagick->getPixelIterator();
/* Loop trough 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) {
/* Make every second pixel 25% red*/
$pixel->setColorValue(\Imagick::COLOR_RED, 64);
}
}
/* Sync the iterator, this is important to do on each iteration */
$imageIterator->syncIterator();
}
$imageIterator->resetiterator();
/* Loop trough pixel rows */
foreach ($imageIterator as $pixels) {
/* Loop through the pixels in the row (columns) */
foreach ($pixels as $column => $pixel) {
/** @var $pixel \ImagickPixel */
if ($column % 3) {
$pixel->setColorValue(\Imagick::COLOR_BLUE, 64); /* Make every second pixel a little blue*/
//$pixel->setColor("rgba(0, 0, 128, 0)"); /* Paint every second pixel black*/
}
}
$imageIterator->syncIterator(); /* Sync the iterator, this is important to do on each iteration */
}
$imageIterator->clear();
$bytes = $imagick;
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
}
resetIterator() ;
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Imagick::profileImage test
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$imagick = new Imagick();
$imagick->newPseudoImage(640, 480, "magick:logo");
$imagick->profileImage('*', null);
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Test Imagick, despeckleImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
function despeckleImage() {
$imagick = new \Imagick();
$imagick->newPseudoImage(640, 480, "magick:logo");
$imagick->despeckleImage();
$bytes = $imagick->getImageBlob();
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
}
despeckleImage() ;
echo "Ok";
?>
--EXPECTF--
OkCopyright (c) 2009, Mark Simonson (http://www.ms-studio.com, mark@marksimonson.com),
with Reserved Font Name Anonymous Pro Minus.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
--TEST--
Test Imagick, distortImage
--SKIPIF--
<?php
$imageMagickRequiredVersion=0x675;
require_once(dirname(__FILE__) . '/skipif.inc');
?>
--FILE--
<?php
$distortion = 1;
$imagick = new \Imagick();
$imagick->newPseudoImage(640, 480, "magick:logo");
$points = array(
0, 0,
25, 25,
100, 0,
100, 50
);
$imagick->setimagebackgroundcolor("#fad888");
$imagick->setImageVirtualPixelMethod( \Imagick::VIRTUALPIXELMETHOD_BACKGROUND );
$imagick->distortImage( \Imagick::DISTORTION_AFFINE, $points, TRUE );
header( "Content-Type: image/jpeg" );
$bytes = $imagick;
if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
echo "Ok";
?>
--EXPECTF--
Ok--TEST--
Test Imagick::getfeatures
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
checkClassMethods('Imagick', array('getfeatures'));
?>
--FILE--
<?php
$features = Imagick::getFeatures();
if (!is_string($features)) {
echo "Features failed to return a string";
}
echo "Ok";
?>
--EXPECTF--
Ok