Jump to content

Problem creating image


DarePoo

Recommended Posts

I'm not very well versed on creating images with the GD functions so that is most likely the problem.  I actually just learned all of this within the past 2 days.  Anyway, I can't get an image to be created.  The code is as follows:

 

<?php

// make uniform picture
$imgdir = "ranks/uniforms/".$_GET['gender']."/";
$uniform = array();
$uniform['rank'] = strtolower($_GET['rank']);
$uniform['uniform'] = @imagecreatefrompng($imgdir."rank-".$uniform['rank'].".png")
$uniform['nametag'] = imagecreatefrompng($imgdir."name-tag.png");
imagecopy($uniform['uniform'], $uniform['nametag'], 80, 170, 0, 0, 47, 16);
$uniform['name'] = strtoupper($_GET['name']);
$uniform['nametag']['font'] = imageloadfont("../font.gdf");
$uniform['nametag']['color'] = imagecolorallocate($uniform['nametag'], 255, 255, 255);
imagestring($uniform['uniform'], $uniform['nametag']['font'], 80, 170, $uniform['name'], $uniform['nametag']['color']);

imagepng($uniform['uniform']);

?>

 

 

That is uniform.php. How I am displaying the image is:

<img src="'.e_PLUGIN.'roster/images/uniform.php?gender='.$member_a['roster_member_gender'].'&rank='.$rank[2].'&name='.$member_a['roster_member_name'].'" border="0" />

All of that is correct. The HTML output is:

<img border="0" src="../../e107_plugins/roster/images/uniform.php?gender=Male&rank=COL&name=Beckwith"/>

That is exactly how it should be, the image just isn't being created.  All the paths are correct in the uniform.php file.

 

Any and all help would be greatly appreciated.

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.