mirror of
https://github.com/Imagick/imagick.git
synced 2026-06-19 07:35:36 +00:00
d19335a4aa
ImageMagick doesn't prevent creation of zero dimension images, instead allowing people to discover errors when you try to use that image. So let us prevent accidental creation. If anyone actually has a sane use for zero dimension images, they can tell us a valid use-case first.
54 lines
823 B
PHP
54 lines
823 B
PHP
--TEST--
|
|
Test pseudo formats
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$im = new Imagick();
|
|
$im->newPseudoImage(100, 100, "XC:red");
|
|
var_dump($im->getImageGeometry());
|
|
|
|
$im->newPseudoImage(10, 10, "magick:logo");
|
|
var_dump($im->getImageGeometry());
|
|
|
|
$im->readImage("magick:logo");
|
|
var_dump($im->getImageGeometry());
|
|
|
|
$im->newPseudoImage(10, 10, "rose:");
|
|
var_dump($im->getImageGeometry());
|
|
|
|
try {
|
|
$im->newPseudoImage(10, 10, "png:");
|
|
var_dump($im->getImageGeometry());
|
|
} catch (Exception $e) {
|
|
echo "fail\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
array(2) {
|
|
["width"]=>
|
|
int(%d)
|
|
["height"]=>
|
|
int(%d)
|
|
}
|
|
array(2) {
|
|
["width"]=>
|
|
int(%d)
|
|
["height"]=>
|
|
int(%d)
|
|
}
|
|
array(2) {
|
|
["width"]=>
|
|
int(%d)
|
|
["height"]=>
|
|
int(%d)
|
|
}
|
|
array(2) {
|
|
["width"]=>
|
|
int(%d)
|
|
["height"]=>
|
|
int(%d)
|
|
}
|
|
fail
|