ID:               19700
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         GD related
 Operating System: Darwin v6 (Mac Server v10.2)
 PHP Version:      4.2.3
 New Comment:

Yes, part of the reason I wanted you to try 4.3.0-dev was to show that
it compiles without trouble on macosx.. :)

Now, are you sure GD itself supports this what you try to do? As the GD
extension in PHP is just a wrapper around the GD functions. You could
also give a try for the bundled GD2 library we have now in 4.3.0-dev.
Just configure with --with-gd=php to enable it. It has some fixes which
are NOT in the 'official' gd distro.



Previous Comments:
------------------------------------------------------------------------

[2002-10-01 22:16:35] [EMAIL PROTECTED]

Note:
this bug may be related to one that I just submitted here:
http://bugs.php.net/bug.php?id=19704

------------------------------------------------------------------------

[2002-10-01 21:58:58] [EMAIL PROTECTED]

If it helps any, if you replace

$final_img = ImageCreate( 800, 600 );
imagecopyresized ( $final_img, $img, 0, 0, 0, 0, 800, 600, 800, 600);
ImageDestroy( $img );
$img = $final_img;

with

ImageTrueColorToPalette( $img, 'TRUE', 256 );

PHP still doesn't work and seems to have the same effect. This code has
the same intention tho.

------------------------------------------------------------------------

[2002-10-01 21:22:11] [EMAIL PROTECTED]

Nope, CVS snapshot doesn't work, same problem.

(It actually compiled on OS X without trouble. Weee!!)

------------------------------------------------------------------------

[2002-10-01 20:31:56] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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

Reply via email to