in reply to Image Conversion to JPEG
This is possible to be done by using :Image::Magick" module Once you Install this package you can read the manual of this module. The manual comes with the Examples you required.
For your information I have added this small example.
> formats to jpg. my($name) = shift; my($img) = Image::Magick->new; if (!($name =~ /.jpg|.JPG/)){ open(IMAGE, $name); # Open the original file $rc = $img->Read(file=>\*IMAGE); # Read the file
To me, the above two lines are a somewhat cumbersome looking way of reading the file. If you must use a pre-opened file handle, maybe it would be worth figuring it out. One idea, is that if you are on Windows, it might be that you need to use "binmade" on the handle, before passing it it Read, I have no idea if Read does such internally.
But it sounds to me that you would be just as happy using
$rc = $mig->Read(filename=>$name);
instead of the above 2 lines, and then... down below...
Again there is more than one way of doing things
Code tags added by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Image Conversion to JPEG = PLAGIARISM
by liverpole (Monsignor) on Oct 08, 2006 at 17:36 UTC | |
|
Re^2: Image Conversion to JPEG
by wfsp (Abbot) on Oct 26, 2005 at 13:04 UTC |