i thought that was what i was doing as i ccp'd in the previous reply, setting the headers on the png file right?
i am new to using GD really, and as far as I know, i didn't think i could set up headers when just calling the imagecreate function
is that an incorrect assumption
again here is where i was calling the my function
require("_barcode_upc.inc");
$im2 = barcode_generate_upca("$GenerateID", false, 100, 20, 1);
Header("Content-type: image/png");
Header("Pragma: no-cache");
Header("Cache-Control: no-store, no-cache, must-revalidate");
ImagePNG($im2,'images/barcodetest.png');
include("index.inc");
exit();
and here is a little snippit from what i am doing in barcode_generate_upca ()
function barcode_generate_upca($barcode_text, $show_text = true, $bar_height = 150, $text_size = 20, $element_width = 2)
{
$data = barcode_encode_upca($barcode_text);
$text_font = "verdana.ttf";
if($show_text) {
list($pos_blx, $pos_bly, $pos_brx, $pos_bry, $pos_trx, $pos_try, $pos_tlx, $pos_tly) = ImageTTFBBox($text_size, 0, $text_font, substr($barcode_text, 0, 1));
$digit_width = $pos_trx-$pos_tlx;
$margin_width = ($element_width*4)+$digit_width;
} else {
$margin_width = ($element_width*2);
}
$width = strlen($data);
$image_width = ($margin_width*2)+($element_width*$width);
$im = ImageCreate($image_width, $bar_height+($show_text?$text_size * 2:0));
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
$y = 10;
$x = $margin_width;
for($a = 0; $a<strlen($data); $a++) {
$color = substr($data, $a, 1)=="1"?$black:$white;
ImageFilledRectangle($im, $x, $y, $x+$element_width, $y+$bar_height, $color);
$x += $element_width;
}
then blah blah blah i return ($im)