I'm having a problem with this snipit of perl:

                            my($image, $x);
                               $image = Image::Magick->new;
                               $x = $image->Read($file);
                               warn "$x" if "$x";
                               my $filetype =  $image->Get('magick');
                               if ("$filetype" ne 'JPEG') {
                                       print "Converting image $file
to a JPEG \n";
                                       $x = $image->Set(magick=>'JPEG');
                                       warn "$x" if "$x";
                                       $file = '/tmp/cover1.jpg';
                                       $x = $image->Write($file);
                                       warn "$x" if "$x";
                               }
                               undef $image;
                               undef $x;

$file in this cases comes in as a PNG, and needs to be written out as
a JPEG. Instead of the expected image I have a picture of a cdrom with
some green hills superimposed over it. What am I doing wrong? I've
tried it with and without Set'ing the magick. This works flawlessly
just using covert.

Thanks,

-Chris

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to