Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GD ImageCopyMerge problem

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I am calling a PHP script from perl to manipulate some pictures. I am building an image out of 5 seperate parts.
I am a bit stuck at this point in a script.
At this point the first created picture is returned to my calling script proving the picture is being created.
Code:
imagejpeg($newim);
The next part of the code creates the main image and should be at the beginning of the script but I have moved it to here for testing.

I create a new image and fill it with colour so it can be seen.
Code:
$framedpic= imagecreate($fullwidth,$fullheight);
$culler = imagecolorallocate ($framedpic,20,20,20);
imagefilledrectangle ( $framedpic, 0, 0, $fullwidth, $fullheight, $culler );
and try to merge the first image into this newly created one here.
Code:
ImageCopyMerge ( $framedpic, $newim, 0, 0, 0, 0, 50, 50, 50)
imagejpeg($framedpic);
Nothing is returned.
If I remove the imagecopymerge function, a black box is returned as expected.
What am I missing here?

Keith
 
The docs say that this function was added in PHP 4.0.6.
Does this GD dump say our server is running version 2.0.28?

Code:
array(10) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(false) ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top