You are not logged in.

#1 2009-09-14 13:30:41

DIDI2002
Member
Registered: 2009-08-06
Posts: 66

Use icons from .exe as thumbnails

Hi Archers,
I'm a little confused nobody _ever_ asked about this one in the forums, but here we go anyways.

I tried to use icons extracted from the .exe as thumbnails in Nautilus. Seems to work so far, but alpha-transparency and size are still messed up.

Currently looks like that: http://img11.imageshack.us/img11/3033/91691770.jpg

Im using a wineicons.sh script from http://www.objectnetworks.net/wiki/inde … _for_Gnome

#!/bin/sh

f=`mktemp`

if wrestool "$1" -x -t14 > $f && [ -s $f ]; then
    id=`icotool -l $f | awk '{
        ci=int(substr($2,index($2,"=")+1));
        cw=int(substr($3,index($3,"=")+1));
        cb=int(substr($5,index($5,"=")+1));

        if (cw > w || (cw == w && cb > b)) {
            b = cb;
            w = cw;
            i = ci;
        }
        }
        END {
            print i;
        }'`

    icotool -x --index=$id $f -o "$2"
#    convert -size 32x32 "$2" "$2"        # optional
else
    cp '/home/chrissi/.icons/gnome-brave/32x32/mimetypes/exec_wine.png' "$2"
fi

rm $f

It's called by using wineicon.sh %i %o as thumbnailer for app/x-ms-dos-executable.
The output from the script looks good, it's a 256*256 .png with transparency, but when it's used as a thumbnail it's got white backgrounds and is not the regular icon-size.

Anyone got any ideas on how to create 48*48 icons with transparency?

Maybe I'll write a wiki-page if it works out well wink

Offline

Board footer

Powered by FluxBB