Image Magick AAAAAhhhh! 
Author Message
 Image Magick AAAAAhhhh!

Please can someone help me before I go completely insane?!

This code (using Image Magick) should output a JPG file containing the text
"Test Text".  Instead it just outputs the image.

(BTW The font arial.ttf is present in the same directory as the pic and the
script)

$img="pic.jpg";
if (file_exists($img))  {
Header("Content-type: image/jpeg");
passthru("/opt/x11/bin/convert -pen 0 -font arial.ttf -draw 'text 100,100
\"Test Text\"' -geometry $heightx$width -bordercolor white -border 0x0 $img
JPG:-");
                                }

many thanks



Sun, 29 May 2005 19:35:50 GMT  
 Image Magick AAAAAhhhh!
"Nel" wrote

Quote:
> This code (using Image Magick) should output a JPG file containing
> the text "Test Text".  Instead it just outputs the image.

I guess you /did/ test the command on the command line? I noticed that the
new version(s) of ImageMagick have different command line options for the
mogrify command, which are not compatible with older releases :-(

Quote:
> "... Test Text\"' -geometry $heightx$width -bordercolor wh..."

I'm quite sure that you need to use the curly braces syntax (or dot
operator) as the variable $heightx does not exist...

Thus:

   " ... -geometry ${height}x$width -border ..."

or

   " ... -geometry " . $height . "x$width -border ..."

Obviously, using

    // Header("Content-type: image/jpeg");
    $command = "/opt/x11/bin/convert -pen 0 -font ... ";
    echo $command;  // debugging only
    // passthru($command);

and then copying that to the command line would have revealed that error!

a.



Mon, 30 May 2005 15:26:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Create Thumbnails with PHP & Image Magick

2. Image Magick from PHP

3. Magick 0.2

4. Magick Variables ?

5. Anyone did this: Magick++ + boost.python

6. import Image vs from PIL import Image vs import PIL.Image

7. image file name changed on image save

8. VisualWorks 2.5.1: Image to Image Communication

9. Need help with LeadTools API and displaying image in image control

10. Moving Apps from image to image

11. Image Searcher: searching images without textual keywords.

12. New Imaging SDK - Image-XChange demo

 

 
Powered by phpBB® Forum Software