Hello,
I want to extract the emblem blob onto my website to show it as an image. Here's the code that i'm using :
$guild_id = mysql_query("SELECT `guild_id` FROM `guild_member` WHERE `char_id` = '" . $row['char_id'] . "'"); // pulling from info based on another table
$guild_data = mysql_result( $guild_id, 0 );
$req = mysql_query("SELECT `emblem_data` FROM `guild` WHERE `guild_id` = '" . $guild_data . "'");
$data = mysql_result( $req, 0 );
$bmp = @gzuncompress(pack('H*', $data));
require_once 'functions/imagecreatefrombmpstring.php';
header('Content-type: image/png');
$img = imagecreatefrombmpstring($bmp);
$count = mysql_num_rows( $req );
echo "<td >";
echo "<table border='1px' style='padding: 2px 0px 2px 7px;'>";
echo "<t";
echo "<td width='38px'><font size='1' color='white'><b>" . $data . "</b></font></td>"; // To test whether $data is being pulled and yes it works.
// Emblem exist.
// Set header, uncompress gzip and show
echo "<td width='20'>" . imagepng($img) . "</td>"; // Website goes for a toss when i use this code without header but it doesnt show the image it either. I'm converting to png as fluxcp aswel does this I thought i'd be fine.
echo "</td>";
If someone can modify or help me with a little information with the above I'd be greatful.
Thankyou!