Jump to content

[SOLVED] New problem with GD and merge two images


Isterklister

Recommended Posts

Hello again,

I have now picked up some code to merge two pictures (with transparency).

<?php

$flag = $_GET['flag'];

/* Attempt to overlay transparent and semi-transparent images */

$width = 800;

$height = 600;

$dst_width = 800;

$dst_height = 600;

 

$bottom_image = imagecreatefrompng("flag-back.png");

$top_image = imagecreatefrompng('$flag');

imagesavealpha($top_image, false);

imagealphablending($top_image, false);

imagecopy($bottom_image, $top_image, 0, 0, 0, 0, $width, $height);

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

$erer = 232;

imagepng($bottom_image);

imageDestroy($bottom_image);

?>

 

I call the sript from another file:

echo "<img src='merge_flag_logo.php?flag=$flag_t[flag]>";

 

The script works fine if I instead of $_GET... just write a picture name instead of $flag.

How can I get the image name with GET and use it in the script?

Thanks

Isterklister

The script works fine if I instead of $_GET... just write a picture name instead of $flag.

How can I get the image name with GET and use it in the script?

 

secondly, then i would guess, you have some complications in the file name that is being entered dynamically into the <img> tag... you may want to check for spaces, and whatnot and urlencode/urldecode to avoid that

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.