Jump to content

imagecolortransparent problem


bhavin12300

Recommended Posts

hi i have one simple code which add transparent color to image and save it as ".png".

it works fine on my local computer using WAMP.

but when i ran same code on server it generate no output image.

 

my php version is 5.3 and server php versoin is 5.2

here is my code

<?php


$info = getimagesize("rose.jpeg");
$width = $info[0];
$height = $info[1];


$im = imagecreatetruecolor($width, $height);
$image = @imagecreatefromjpeg("rose.jpeg");

$black = imagecolorallocate($im, 255, 255, 255);
imagecolortransparent($im, $black);

imagecopy($im, $image, 0, 0,0 ,0,$width, $height);

imagepng($im, 'output.png');
imagedestroy($im);
?>

 

can you let me know why whats reason? how can i make it run on server?/

 

 

Link to comment
Share on other sites

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.