Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Merge multiple BMP images into ICO files

by jimbojones (Friar)
on Mar 22, 2007 at 14:53 UTC ( [id://606044]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Merge multiple BMP images into ICO files
in thread Merge multiple BMP images into ICO files

Hi

I based that comment on seeing the following pulled down from ActiveState PPM:

Installing C:\Progra~1\Perl\Perl586_811\site\lib\auto\Imager\File\ICO\ +ICO.dll
So at least for the .ico support, it seems to need a .dll.

Thanks, J

Replies are listed 'Best First'.
Re^5: Merge multiple BMP images into ICO files
by Corion (Patriarch) on Mar 22, 2007 at 14:58 UTC

    Large parts of Imager are written in XS, which is mostly C with some Perl macros. On Win32, XS gets compiled into .dll files. On other platforms, it gets compiled into whatever format dynamically loadable libraries have. You can find out the filename extension for a platform by inspecting the output of perl -V:so on that platform:

    Win32:

    Q:\>perl -V:so so='dll';

    Solaris:

    $ perl -V:so so='so';
      Hi

      Sorry, I was being too particular in my use of .dll to mean XS code. I would prefer to not have to compile XS code across multiple OSs. A pure Perl solution would be preferable; the reasons are in Re^2: Merge multiple BMP images into ICO files. But as I said in that node, I may be wasting my time looking for/writing a pure Perl solution and will go either with Imager or ImageMagick.

      Thanks for your help. - J
Re^5: Merge multiple BMP images into ICO files
by tonyc (Pilgrim) on Mar 29, 2007 at 01:03 UTC

    The ICO.dll (or ICO.so, or ICO.bundle) is created during the build process. All of the code Imager requires to support ICO is part of Imager (most of the format support is in ICO/msicon.c).

    The structure of images inside an ICO file is similar enough to BMP that you could probably write a simple script (or module) to do the conversion. One issue is that .ico doesn't allow compressed images, but you could test for that, since you need to parse the bmp header for the image size anyway.

      Hi

      I understand that the shared library is created from the XS code at build time. I was looking for a pure-Perl solution that could be distributed without having to build or install.

      I also tried, for a day or two, to write the script/module you describe. I got about 80% of the way, but really didn't have enough time at $job to persue it. I reverted to systeming out to a command-line image conversion. I may return to this problem in the future.

      Thanks for the reply.

      - j

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found