image not showing in the doc

Jun 9, 2011 at 12:45 PM


i have another prob i hope someone can help me with. I use the gd library to output an image to a doc (code below)


public function createDoc(){
   echo '<img src="http://localhost/label_creator/wp-content/plugins/labels/lebelimage.php" />';
    $section = $this->createSection();
    $section->addText('hello world');
    $objWriter = PHPWord_IOFactory::createWriter($this, 'Word2007');

the lebelimage.php script

$image = imagecreatefromjpeg('http://localhost/label_creator/wp-content/media/Become-a-friend_small.jpg');
// Tell the browser we will output a PNG image
header("Content-Type: image/jpg");
// Output the image to the browser in PNG format

The echo script in the first code block is to output the gd image to the browser which works, so i know it's coming through ok. 
The problem i'm having is on the doc folder the image placeholder is there but there is no image just a red cross (screen shot here )
if i create the image from scratch from the gd library it works but when using an image from the server i get the prob, i haven't sent the dimensions but it works these out so something is coming through, stumped.