ID: 19700
User updated by: sprice@wisc.edu
Reported By: sprice@wisc.edu
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: Darwin v6 (Mac Server v10.2)
PHP Version: 4.2.3
New Comment:
Nope, CVS snapshot doesn't work, same problem.
(It actually compiled on OS X without trouble. Weee!!)
Previous Comments:
------------------------------------------------------------------------
[2002-10-01 20:31:56] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
------------------------------------------------------------------------
[2002-10-01 20:12:57] sprice@wisc.edu
When I am copying a true color image to a regular image using
ImageCopy() PHP dies and nothing is returned.
ie:
(1 sec)
1482 httpd 27.4% 0:10.96 1 8 164 3.77M- 13.1M+ 6.34M
38.2M+
(1 sec)
1514 c++filt3 0.0% 0:00.01 1 9 14 48K 396K 268K
1.37M
1513 crashdump 102.5% 0:01.35 2 15 405 25.2M+ 21.1M+ 33.2M+
59.7M+
1482 httpd 0.0% 0:10.96 1 8 164 3.77M 13.1M+ 6.34M
38.2M
(1 sec)
1514 c++filt3 0.0% 0:00.01 1 9 14 48K 396K 268K
1.37M
1513 crashdump 99.8% 0:02.40 2 15 405 25.2M 21.1M 33.2M
59.7M
1512 top 4.7% 0:00.42 1 15 18 208K 376K 488K
13.8M
1482 httpd 0.0% 0:10.96 1 8 164 3.77M 13.1M 6.34M
38.2M
Here are some example scripts. Notice that ImageCopyResized() works,
but ImageCopy() doesn't in the last script.
This code works:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
//Work-around for another bug.
$x = (int) '1053';
$y = (int) '626';
$img = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );
$medimg = ImageCreateTrueColor( 800, 600 );
ImageCopy( $medimg, $img, 0, 0, 0, 0, 800, 600 );
ImageDestroy( $img );
$img = $medimg;
$final_img = ImageCreate( 800, 600 );
imagecopyresized ( $final_img, $img, 0, 0, 0, 0, 800, 600, 800, 600);
ImageDestroy( $img );
$img = $final_img;
ImagePNG( $img );
ImageDestroy( $img );
?>
This code works:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
//Work-around for another bug.
$x = (int) '1053';
$y = (int) '626';
$img = ImageCreate( 800, 600 );
$medimg = ImageCreateTrueColor( 800, 600 );
ImageCopy( $medimg, $img, 0, 0, 0, 0, 800, 600 );
ImageDestroy( $img );
$img = $medimg;
$final_img = ImageCreate( 800, 600 );
imagecopy ( $final_img, $img, 0, 0, 0, 0, 800, 600);
ImageDestroy( $img );
$img = $final_img;
ImagePNG( $img );
ImageDestroy( $img );
?>
This code works:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
//Work-around for another bug.
$x = (int) '1053';
$y = (int) '626';
$img = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );
$medimg = ImageCreateTrueColor( 800, 600 );
ImageCopy( $medimg, $img, 0, 0, 0, 0, 800, 600 );
ImageDestroy( $img );
$img = $medimg;
ImagePNG( $img );
ImageDestroy( $img );
?>
This code works:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
//Work-around for another bug.
$x = (int) '1053';
$y = (int) '626';
$img = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );
$final_img = ImageCreate( 800, 600 );
imagecopy ( $final_img, $img, 0, 0, 0, 0, 800, 600);
ImageDestroy( $img );
$img = $final_img;
ImagePNG( $img );
ImageDestroy( $img );
?>
This code doesn't:
<?php
header( "Content-type: image/png" );
$medimg = $_SERVER['DOCUMENT_ROOT'] .
"/riverdata/images/world_map_med.gd2";
//Work-around for another bug.
$x = (int) '1053';
$y = (int) '626';
$img = ImageCreateFromGD2Part( $medimg, $x, $y, 800, 600 );
$medimg = ImageCreateTrueColor( 800, 600 );
ImageCopy( $medimg, $img, 0, 0, 0, 0, 800, 600 );
ImageDestroy( $img );
$img = $medimg;
$final_img = ImageCreate( 800, 600 );
imagecopy ( $final_img, $img, 0, 0, 0, 0, 800, 600);
ImageDestroy( $img );
$img = $final_img;
ImagePNG( $img );
ImageDestroy( $img );
?>
Sorry if this is a dupe. I some other bugs that may have something to
do with this, but then again, maybe not. If you want a GD2 image for
testing, you can use this one:
http://144.92.10.251/riverdata/images/world_map_med.gd2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19700&edit=1