#97 Wrong format in example script on web page

closed-fixed
None
5
2008-09-09
2008-09-08
Anonymous
No

GIF instead of PNG:
http://www.graphicsmagick.org/www/perl.html#exam

Example Script

Here is an example script to get you started:

#!/usr/local/bin/perl
use Graphics::Magick;
my($image, $x);
$image = Graphics::Magick->new;
$x = $image->Read('girl.png', 'logo.png', 'rose.png');
warn "$x" if "$x";
$x = $image->Crop(geometry=>'100x100"+1"00"+1"00');
warn "$x" if "$x";
$x = $image->Write('x.png');

I suppose the last line should be:
$x = $image->Write('x.gif');

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2008-09-09

    There is nothing wrong with requesting the PNG format but the syntax of the Crop line is clearly messed up. Something (maybe an HTML editor) has inserted a bunch of double quotes where they don't belong. I also notice a missing single-quote in one of the other examples.

    Thanks for the report!

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2008-09-09
    • assigned_to: nobody --> bfriesen
    • status: open --> closed-fixed
     
  • Nobody/Anonymous

    @bfriesen
    The problem with requesting the PNG format is that the code does something else according to the description which says
    "[...] and writes a single image as a GIF animation sequence. [...]"

    Sorry, maybe I should have mentioned that in the first place.

    I don't really understand the code but the quotes work fine for me...

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2008-09-10

    I see. You are right. I have now changed the "png" to "gif". Thanks for your correction.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks