in reply to Image::Magick woes

You are using an undocumented bit of the interface (but the docs are sparse). Does this not work? It works fine for me.

use Image::Magick; my $tmpName = 'd:/proxy/html/images/email.gif'; my $thumb = Image::Magick->new(); $thumb->Read( $tmpName ); my ( $height, $width ) = $thumb->Get( 'height', 'width' ); print "$tmpName: $height h $width w\n"; __DATA__ d:/proxy/html/images/email.gif: 14 h 14 w

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Image::Magick woes
by geektron (Curate) on Sep 05, 2003 at 04:00 UTC
    i yanked what i'm doing straight outta the docs.

    i'm leaning towards b0rked install ... because it works intermittantly, and/or only for JPGs.

    i'm going to fight more ... i guess

    thanks

Re: Re: Image::Magick woes
by geektron (Curate) on Sep 05, 2003 at 04:09 UTC
    blurge. that works fine ... thanks again.

    i wish i understood why the filehandle version wasn't working, though. it's *in* the Image::Magick does ( the web version ), so it's documented.....

      You are right it is on their site, just not in the main docs. It does not work because it is not correctly implemented (obviously). You can see the implementation in Magick.xs and if you know a bit of C and perlguts you can probably work out why. Follow the callback trail through Read->SetupList->GetList. I just can't really see that syntax implemented anywhere. In practical terms you need to look for the string 'file' as this is a plain SV but so is '/path/to/file.gif' which is a path to a real file. The => is just a comma. But I only had a very quick look.

      It is a BUG so you should report it. Either a doc bug or a code bug depending on how you want to look at it.

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        I always just call Image::Magick straight, keeps things simple IMO. Dunno if that works for you.

        my $command = "identify $file";
        my $answer = `$command`;

        #strip out info you need from answer with regular expressions

        #build up a convert command

        $command = "convert + #whatever you need to make convert work#";
        system($command);