php-developer-list | 2002112

[PHP-DEV] Some image functions are broken From: Marcus Börger (marcus.boerger <email protected>)
Date: 11/29/02

i was just about to create some image (ext/gd) tests while i found
out that imagegd2 and imagefromgd functions are broken. I checked
with versions 4.3 and cvs.

- You can convert an image to gd but you cannot reload it.
- You cannot create an gd2 image.
- png -> jpeg and reverse is good.

[marcus <email protected> php4-HEAD]$ make sapi/cli/php ; php -r
'imagegd(imagecreatefrompng($argv[1]), $argv[2]);' -- ext/gd/tests/test.png
ext/gd/tests/test.gd
make: `sapi/cli/php' is up to date.
[marcus <email protected> php4-HEAD]$ make sapi/cli/php ; php -r
'imagegd2(imagecreatefrompng($argv[1]), $argv[2]);' --
ext/gd/tests/test.png ext/gd/tests/test.gd2
make: `sapi/cli/php' is up to date.
Segmentation fault
[marcus <email protected> php4-HEAD]$ make sapi/cli/php ; php -r
'imagepng(imagecreatefromgd($argv[1]), $argv[2]);' -- ext/gd/tests/test.gd
ext/gd/tests/test1.png
make: `sapi/cli/php' is up to date.
Segmentation fault
[marcus <email protected> php4-HEAD]$ make sapi/cli/php ; php -r
'imagejpeg(imagecreatefrompng($argv[1]), $argv[2]);' --
ext/gd/tests/test.png ext/gd/tests/test.jpeg
make: `sapi/cli/php' is up to date.
[marcus <email protected> php4-HEAD]$ make sapi/cli/php ; php -r
'imagepng(imagecreatefromjpeg($argv[1]), $argv[2]);' --
ext/gd/tests/test.jpeg ext/gd/tests/test.1.png
make: `sapi/cli/php' is up to date.
[marcus <email protected> php4-HEAD]$ cm
cmp cmuwmtopbm
[marcus <email protected> php4-HEAD]$ cmp ext/gd/tests/test.png ext/gd/tests/test.1.png
ext/gd/tests/test.png ext/gd/tests/test.1.png differ: char 36, line 3

They differ because jpeg compression losses. :-) But the result looks o.k.

marcus

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php