Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Image::Magick and JPEG Compression

by OzzyOsbourne (Chaplain)
on Jun 07, 2002 at 19:07 UTC ( #172617=perlquestion: print w/replies, xml ) Need Help??
OzzyOsbourne has asked for the wisdom of the Perl Monks concerning the following question:

I loaded the Image::Magick module, and wanted to create a compressed JPEG. I thought this would be easy, but I'm missing something. I can write JPEGs, just not compressed ones.


I checked the docs, and I checked google, but I can't seem to find a straight answer on what may be going wrong. Is there a module that I'm missing to get this to work on a win2k box?

Thanks in advance.


Replies are listed 'Best First'.
Re: Image::Magick and JPEG Compression
by webfiend (Vicar) on Jun 07, 2002 at 19:20 UTC

    I might be missing something myself, but isn't JPEG a compressed format itself? If that were the case, wouldn't fiddling with the quality parameter result in different levels of compression?

    A quick scan of google didn't show me anything to set "jpeg" apart from "compressed jpeg" - most links were describing jpegs as compressed when compared to formats such as bitmap.

    "All you need is ignorance and confidence; then success is sure."-- Mark Twain
Re: Image::Magick and JPEG Compression
by beernuts (Pilgrim) on Jun 07, 2002 at 21:38 UTC
    What do you get for an error? Try:
    my $x = $image->Write(filename=>$file,compression=>'JPEG',quality=>'10 +'); warn "$x" if "$x"; $x =~ /(\d+)/; print "ERROR: [$1]\n";

    You can get the error codes (as well as the above error example) here:

    This might be useful too, as you're using Win2K:


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://172617]
Approved by OzzyOsbourne
[Discipulus]: uch! so we are twice lucky to have MCE..;=)
[marioroy]: Working a midnight graveyard shift, on the way home ran out of gas. just 2 minutes later somebody stops with a small tank of gas. It's wierd. There's always someone nearby for some reason.
[Lady_Aleena]: I was the one who stop[ed in the middle of a cold night to pick up a small family walking to a gas station. I got a few gallons of free gas for the round trip, and the grandmother said she'd pray for me.
[marioroy]: Folks do not know it, but MCE was ridiculously difficult. At Niagra Falls, heard a voice on enabling Grace while in the mist boat. That 10x performance is possible.
[marioroy]: Lady_Aleena Angels on earth are real people. That's awesome.
[Lady_Aleena]: marioroy, what does MCE stand for in this instance? There are 3 pages of abbreviations to go through.
[Lady_Aleena]: ^ or Discipulus...
[marioroy]: Many-core Engine
[choroba]: MCE
[karlgoethebier]: is about to reach nirvana tonight...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-05-29 08:26 GMT
Find Nodes?
    Voting Booth?