Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Convert .tif to .gif

by ksublondie (Friar)
on Jun 23, 2015 at 20:46 UTC ( [id://1131733]=perlquestion: print w/replies, xml ) Need Help??

ksublondie has asked for the wisdom of the Perl Monks concerning the following question:

I currently have a server running ActiveState perl 5.8 that is using Image::Magick module and ImageMagick to convert multiple tiff's into gif's for import into a web server through a scheduled task. It's working great, except I was informed a week ago the old ImageMagick version is showing up in our vulnerability scans and it needs to be upgraded.

I tried simply updating the ImageMagick to the latest version, but it's not compatible with perl 5.8, so no go. Then I attempted to install the latest version on another server running ActiveState perl 5.20...even though the documentation SAYS it'll work with and install the modules for ActiveState, it looks like it only installs the perl module for Strawberry and I get an error at installation.

So I looked into trying a different module that would give me the same end result (convert tiff to gif, that's ALL I want to do...), so I installed Imager, but the actual conversion step in the code:

$image->write(file=>$file,type=>'gif') or die $image->errstr();

gives an error saying:

format 'tiff' not supported - formats bmp, ico, pnm, raw, sgi, tga available for reading - Can't locate Imager/File/TIFF.pm

which tells me I need to install libtiff & libgif.

So found the installers, but I didn't have any C compilers installed...found the C installers, but I'm not sure if they were successful...libtiff & libgif installs are still giving errors. Yadda, yadda, yadda...I feel like I've followed a rabbit down a hole. I've been working on this a week and still haven't made any progress.

Is there an easier way to do this (tiff to gif)? Is there a module out there that is an easier install? Or do I just need to keep on keeping on with the path I'm going?

UPDATE: I gave up and installed Strawberry. Now I'm thrown into figuring out the nuances of having ActiveState and Strawberry running concurrently on the same machine. Even with the Strawberry, I was still unsuccessful in trying to get the PerlMagick installed. Finally I was able to get Imager to install with the tiff & gif libs and flushed ImageMagick.

Replies are listed 'Best First'.
Re: Convert .tif to .gif
by marto (Cardinal) on Jun 24, 2015 at 10:01 UTC

    From the documentation:

    "The simplest way to install the libraries used by Imager is to install Strawberry perl.

    You can then use either the bundled Imager, or install from CPAN."

    Strawberry perl ships with a C compiler, build tools, stacks of commonly used modules and dependant libraries. If you're working on a Microsoft Windows platform and want to make life easy for yourself, use Strawberry perl. Example release notes detailing additional modules/libraries http://strawberryperl.com/release-notes/5.22.0.1-32bit.html.

Re: Convert .tif to .gif
by Anonymous Monk on Jun 24, 2015 at 10:31 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1131733]
Approved by marinersk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found