Jump to content

Recommended Posts

Hi,

I'm currently messing around with using PHP to use dynamic sigs for forums and such, however I've come across a bit of a problem using one of my images.

 

<?php

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

class sig {
public function sig() {
	$image = imagecreatefrompng("sigs/blue_proto.png");;

	imagepng($image);
	imagedestroy($image);
}
}

new sig;
?>

 

Here is the image I am trying to use:blue_proto.png

 

And here is what happens when I use it in PHP:

problem.jpg

 

As you can see, for some reason the left size of my image gets cut off, and the transparency at the bottom seems to fail. This is my first time working with images in PHP, sorry if there is an obvious solution :P

 

Thanks,

Letterbomb05.

 

Link to comment
https://forums.phpfreaks.com/topic/149676-solved-php-png-image-problem/
Share on other sites

I've only done a little with GD, but I can say that I think PNG is opened as indexed, so the transparency won't work. without doing other stuff...

Try:

<?php

function LoadPng($imgname);

{

$im=@imagecreatefrompng($imgname);

return $im;

}

 

header("Content-Type: image/png");

$img=LoadPng("sigs/blue_proto.png");

imagepng($img);

?>

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.