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

Help with Imager::File::PNG

by Fair Strides (Acolyte)
on Aug 27, 2013 at 06:17 UTC ( #1051068=perlquestion: print w/replies, xml ) Need Help??
Fair Strides has asked for the wisdom of the Perl Monks concerning the following question:

Hello, Perlmonks.com! I've been here in the past for solutions or to blow off time in school, but now I have a problem that's rather annoying.

I'm editing some source code for a (http://knightsoftheoldrepublic.filefront.com/file/KOTOR_and_TSL_Save_Game_Editor_English_Language_Only;68852). The guy who programmed it used Tk::PNG and Imager::File::PNG to make the icons for the items in the inventory, since the games uses .tga files with alpha channels.

My problem is that I downloaded (http://gnuwin32.sourceforge.net/packages/zlib.htm) zlib and (http://gnuwin32.sourceforge.net/packages/libpng.htm) libpng(the first link on each page, marked "Setup") and installed them to C:\Program Files\GnuWin32. Now when I try to use CPAN in the command prompt, I type "install Imager::File::PNG", and I get (http://ppm4.activestate.com/MSWin32-x86/5.16/1600/T/TO/TONYC/Imager-File-PNG-0.89.d/log-20130716T041338.txt) this.

Sorry for the long post, but bottom line: Can anyone help me with installing this? I have Win XP, btw. If no one can help me, Are there any alternatives that work with Tk that will let me use the images without showing the alpha layer?

Thanks for reading, and happy programming!

Replies are listed 'Best First'.
Re: Help with Imager::File::PNG
by runrig (Abbot) on Aug 27, 2013 at 06:46 UTC
    Try Strawberry Perl. I think Imager::File::PNG may come with it...I have strawberry perl 5.14 installed, and Imager::File::PNG seems to be installed...I'm not sure but I think it came with the perl, if not, it must have been easy to install.

      Okay. I'll try that in the next few days. I tried 5.16 of that a while ago, but it didn't have Tk and a few others installed. I forget if it still has PPM.

      Edit: My problem is that make/dmake can't find libpng/zlibon my pc.Had the same issue on my bro's laptop, with no solution.

        I forget if it still has PPM.

        It is there, but there's much less need for it w/Strawberry. Install App::cpanminus, and just install everything via cpanm.

Re: Help with Imager::File::PNG
by aitap (Curate) on Aug 27, 2013 at 09:08 UTC

    Quoting ExtUtils::MakeMaker documentation:

    INC
    Include file dirs eg: "-I/usr/5include -I/path/to/inc"

    Try opening a command prompt inside the unpacked source code directory (cpan> look Imager::File::PNG) and run the installation commands manually, passing INC="-IC:\Progra~1\GnuWin32\include" (I am not sure about how to pass a quoted string inside a quoted string in Windows CMD, so using DOS-style paths) as a command line parameter parameter to perl Makefile.PL.

      Sorry,but that didn't work. I still got the same errors.

Re: Help with Imager::File::PNG
by Anonymous Monk on Aug 27, 2013 at 07:35 UTC
      Or if you (the OP) insist on using ActiveState perl, find the same version of Strawberry, and copy the library files that you want from it...they are likely compatible (I have in the past copied DBD::* libraries and XML::LibXML). Don't forget to copy the files under the auto directory (*.bs, *.dll).

      Now using Strawberry Perl 5.16.3. Now it compiles and runs, but the transparency isn't there. I ran the original, unedited source code that had the transparency, but it wasn't there.

      Issue with Imager, you think?

        Issue with Imager, you think?

        Doubt it. Probably issues with Tk+operatingsystem, not all of them support transparency ... but then again without short code that demonstrates the problem its all guessing :)

Re: Help with Imager::File::PNG
by pvaldes (Chaplain) on Aug 28, 2013 at 13:27 UTC

    Trying to understand the question...

    "I'm editing some source code for a script. The guy who programmed it used Tk::PNG and Imager::File::PNG to make the icons for the items in the inventory, since the games uses .tga files with alpha channels.

    My problem is that I downloaded zlib and libpng (the first link on each page, marked "Setup") and installed them to C:\Program Files\GnuWin32. Now when I try to use CPAN in the command prompt, I type "install Imager::File::PNG", and I get this."

    ... Warning (mostly harmless): No library found for -lpng PNG: building independently PNG: Generic: includes not found - libraries not found PNG: v1.6: includes not found - libraries not found PNG: v1.5: includes not found - libraries not found PNG: v1.4: includes not found - libraries not found PNG: v1.2: includes not found - libraries not found PNG: v1.0: includes not found - libraries not found PNG: base (+libz): includes not found - libraries not found PNG: v1.6 (+libz): includes not found - libraries not found PNG: v1.5 (+libz): includes not found - libraries not found PNG: v1.4 (+libz): includes not found - libraries not found PNG: v1.2 (+libz): includes not found - libraries not found PNG: v1.0 (+libz): includes not found - libraries not found PNG: Checking if the compiler can find them on its own
    OS unsupported: PNG libraries or headers not found
    PNG: Test code failed: Can't link/include 'png.h', 'stdio.h', 'png' Warning: No success on command[C:\Perl-5.16\bin\perl.exe Makefile.PL] TONYC/Imager-File-PNG-0.89.tar.gz C:\Perl-5.16\bin\perl.exe Makefile.PL -- NOT OK Running make test Make had some problems, won't test. Could not read metadata file. Fa +lling back to other methods to determine prerequisites. Finished...

    Updated:

    Ok, maybe you need to install this zlib?...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1051068]
Approved by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-07-21 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (448 votes). Check out past polls.

    Notices?