Jump to content

Recommended Posts

I have been trying this for two days now, I just want to run imagecopy to get part of two different images into an image for display.  At any rate, I can get the image to show up if I save it and open it in photoshop, but I can never get it to render in a browser.  Here, is some relatively ugly code using imagecopymerge() that I tried the last time I did it.  It always shows an empty image box, but if get the image properties, it gives me a size of 0 x 0, a bpp of 0, but the filesize is spot on.

 

<?php

  $background = imagecreatefrompng("http://www.tennis-schedule.com/images/visix/Red-Blue_Logo_Three.png");

  $foreground = imagecreatefrompng("http://www.tennis-schedule.com/images/visix/Marriott-Background.png");

  imagecopymerge($background, $foreground, 0, 0, 0, 0, 256, 256, 60);

  header('Content-type: image/png');

  imagepng($background);

  imagedestroy($background);

  imagedestroy($foreground);

?>

 

Edit: Almost forgot, the server is running 4.3.11, with GD 2.0.28

 

 

Link to comment
https://forums.phpfreaks.com/topic/63487-solved-image-never-renders/
Share on other sites

didn't see it buried because its below everything, try forcing it to the top, if you are supressing errors it might not realize the errror and this sounds like a classic header error.

 

I've tried it about everywhere, but I'll put it at the top.

 

 

Nope. . . Still broke.  I always put my header info right before the stream, it's worked on other servers.  Evne running similar configs and versions.

Hmm, your code as posted worked fine for me ???

 

Image size 1280 x 720 with a 256 x 256 semi-transparent pink and white image in top left

 

 

Are you placing on page with

 

<img src='myimage.php' >

 

(where myimage.php is the above script)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.