icns2png

Individual Icons/-sets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

0
Score 61%
Last changelog:

16 years ago

1.4+)
Now has support for 256x256 and 512x512 icns images, and command-line support for choosing various sizes and depths.

Now has batch extraction support

IlMaz

16 years ago

Finally I can use this program on my Mandrake8.1... I love Mac icons. Great piece of software! Thank you for the source!

Report

noonespecial

16 years ago

Perfect! Everything in SNOW.E converted fine :) This package really fills a need!

Report

noonespecial

16 years ago

It's worked great for me for every .icns icon so far except the ones in the SNOW.E aqua theme. Running "file" on them shows this:

Macintosh MacBinary data, type "Icon", creator "Mngl"

But trying to convert, I get this error:

Converting Finder to Finder.png...
Error loading icns resource!
Unable to find requested icon data!
Icon image is NULL!
Conversion of Finder failed!

Any idea what's wrong?

Report

C

mathew

16 years ago

It is not parsing the resource maps on that icon set properly... I am looking into it.

Report

C

mathew

16 years ago

...forks.

I found the problem - it is with a 3 byte int (!!??) in the mac os resource maps.

I think this should fix the rest of the problems people are having, so I will release 0.5 non beta as soon as I figure out how to read the 3 byte int on x86.

On a side note, if people are willing to give a little in donations, I am now willing to open source GPL. Think of the possibilities... :D

Report

noonespecial

16 years ago

I didn't expect a reply to that, honestly :)

Good to know the problem is at least tracked down; do you have an idea of when 0.5 might be ready? If icns2png can reliably convert all OSX icons, I think it would be worth the donation you ask for to get a KFile_ICNS plugin into KDE.

Report

C

mathew

16 years ago

I wasn't really expecting a reply either... But then... I did get one :D

Thought the techies might like to know that stuff, but then, this isn't exactly a devel forum.

I am already planning a kfile plugin, and also want kview to support the format.

I need a bit of input from some kde development savvy people.

E-mail me: mathew%bearca!.com (Obvious changes to address)

Expect 0.5 within the week...

-Mathew

Report

bdufour

16 years ago

Thanks for the great program, but while using it I often get files that do not have the .png extension (e.g .pnQ is a rather common one). Also, I get a lot of segmentation faults, preventing the conversion of many icons.

I am thinking that these 2 problems might be related. They remind me of the (common) mistakes that people make when manipulating char arrays.

Report

C

mathew

16 years ago

Any chance you could tell me which filenames you're converting, and mabye post a gdb run?

Report

bdufour

16 years ago

The names of the files I am converting are rather simple (e.g. heart_green).

Here's the output from my gdb session:
----------
$ gdb icns2png
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run heart_green
Starting program: /home/bdufour/bin/icns2png heart_green
Icon2PNG Linux Edition - (C) 2002 Mathew Eis
Converting heart_green to heart_green.png...

Program received signal SIGSEGV, Segmentation fault.
0x40191a5e in _int_malloc () from /lib/libc.so.6
----------
Thanks for your help.

Report

C

mathew

16 years ago

Thanks for the gdb post... Good call on the filename char arrays.

It would technically die any time the new title was longer than the old one, since I allocated the old title's size for the new one.

This explains why some people thought you needed the .icns extension - It wouldn't segfault on the filenames.

I'll post a fixed version this afternoon.

Report

bdufour

16 years ago

... a lot for your help!

Report

Luke

16 years ago

icns2png: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Reckon you could link a version with libc6?

Report

C

mathew

16 years ago

Luke,

Sorry I took so long to respond.

Could you clue be in a bit more?... I thought I had linked it with libc6. ( I built it on a borrowed RH 8.0 system )

Here is a copy of the essential parts of my Makefile:

------------------------------------
# Makefile for Icns2PNG, MacOS X / Linux
# Copyright (C) 2002 Mathew Eis

# version number
version=0.2b

# where make install puts icns2png
prefix=/usr/local

# Where the libpng and zlib library and include files are located
LPNGINC=libpng-1.2.5
ZLIBINC=zlib-1.1.4
LPNGLIB=libpng-1.2.5
ZLIBLIB=zlib-1.1.4

CC=c++

CFLAGS=-O -I$(LPNGINC) -I$(ZLIBINC)
CPPFLAGS=$(CFLAGS)
LDFLAGS=-L. -L$(LPNGINC) -L$(ZLIBLIB) -lpng12 -lz -lm
LDFLAGS_A=-L$(LPNGINC) -L$(ZLIBLIB) $(LPNGLIB)/libpng.a -lz -lm

OBJS = icns2png.o iconvert.o pngwriter.o byteswap.o

all: icns2png

test: icns2png
@cd test; rm -f OmniWeb.png Snow.png; \
if ../icns2png OmniWeb.icns Snow; then \
echo 'Icns2PNG test successful!'; \
else \
echo 'Icns2PNG test failed internal error'; \
fi; cd ..;

install: icns2png
install -m 755 -o root -g wheel icon2png $(prefix)/bin

release: icns2png test
@mkdir -p icon2png-$(version); \
cp icns2png icon2png-$(version); \
cp README icon2png-$(version); \
rm -f icon2png-$(version).tar; \
tar -cf icon2png-$(version).tar icon2png-$(version); \
rm -rf icon2png-$(version); \
echo 'Icns2PNG $(version) release package created.'; \
rm -f *.o;

icns2png: $(OBJS)
$(CC) -o icns2png $(CFLAGS) $(OBJS) $(LDFLAGS_A)

clean:
rm -f *.o icns2png
---------------------------

Let me know what to change for you.

Report

Yaba

16 years ago

Execute ldd to see the dependencies

Report

ecke

16 years ago

How do you actually unstuff the .sit.hqx files? I have run unstuff twice, first on the .hqx and then on the .sit and just end up with some 0 byte files and sometimes a file of some kb that aren't icon files.
Any hint welcome.

Report

Luke

16 years ago

When you unstuff, use
unstiff -m=on

Report

Luke

16 years ago

ok that was an unfortunate typo :)

Report

shok

16 years ago

a great work for a great program. fantastic work. thanks

Report

Tachyon

16 years ago

Am I missing something? Is there a way to convert all the files in a directory at once? I tried normal wildcards, but it didn't work. Any help or ideas whould be greatly appreciated. TIA

ps. great prog. I've been wanting something like this for awhile.

Report

Yaba

16 years ago

I don't know the syntax of this program, but I assume it works like

icon2png mac.icn new.png

then type something like this on your friendly bash:

for i in (find . -name \*.icn); do
icon2png $i ${i%icn}png
done

Report

Tachyon

16 years ago

Thanks I actually came up with almost the same thing on my own since my last post, but yours is a bit cleaner..... I'm still learnig shell scripting.

Report

16 years ago

1.4+)
Now has support for 256x256 and 512x512 icns images, and command-line support for choosing various sizes and depths.

Now has batch extraction support

product-maker 62 102

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
1.4
updated Apr 12 2008
added Dec 17 2002
downloads today
0
page views today 1
System Tags iconset linux unix