Jump to content

Merging images


Michdd

Recommended Posts

I tried this:

 

<?php
// Create image instances
$dest = imagecreatefrompng('http://tfg.game-host.org/bin/tfgcwp?Arcitex.png');
$src = imagecreatefrompng('http://eoinfo.no-ip.org:8080/playercards.php?name=arcitex&card=1.png');

// Copy and merge
imagecopymerge($dest, $src, 0, 0, 20, 20, 380, 128, 100);

// Output and free free from memory
header('Content-Type: image/png');
imagepng($dest);

imagedestroy($dest);
imagedestroy($src);
?>

 

It's just showing a broken image. It's not working..

Link to comment
https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663105
Share on other sites

Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: Read Error: truncated data in ### on line 4

Warning: imagecreatefrompng() [function.imagecreatefrompng]: gd-png error: setjmp returns error condition in ### on line 4

Warning: imagecreatefrompng() [function.imagecreatefrompng]: 'http://tfg.game-host.org/bin/tfgcwp?Arcitex.png' is not a valid PNG file in ### on line 4

Warning: imagecopymerge(): supplied argument is not a valid Image resource in ### on line 8

Warning: Cannot modify header information - headers already sent by (output started at ###:4) in ### on line 11

Warning: imagepng(): supplied argument is not a valid Image resource in ### on line 12

Warning: imagedestroy(): supplied argument is not a valid Image resource in ### on line 14

 

I have no idea why, but i'm getting those error messages.

Link to comment
https://forums.phpfreaks.com/topic/128053-merging-images/#findComment-663259
Share on other sites

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.