On Tue, 23 Dec 2008 16:12:45 -0500
Ignac Vucko <[email protected]> wrote:

>Thanks for the idea zentara,
>
>But, unfortunately, I have 200K images to convert, about 2K of which 
>exhibit this phenomena...
>I was hoping there was a "force" flag that would allow imagemagick to 
>treat a file as .ico and ignore
>the fact that the header is not "perfect".
>
>Is there another command line linux tool I can use to convert or correct 
>the images?
>
>ignac

Yes. I tried to get gimp running in either batch mode or Perl, but
nearly went crazy. :-)

Fortunately, Perl/Gtk2 also handles ico files correctly.
This script will run from the commandline, will NOT open a window,
but needs to be running in X, so Gtk2 will run.
It will convert all .ico files to .png


#!/usr/bin/perl
use warnings;
use strict;
use Gtk2 -init;

my @files = <*.ico>;

foreach my $filename (@files){
    my $temp = $filename;
    $temp =~ /^(.*)\.ico$/;
    my $base = $1;
    #print "$base\n";

  my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($filename);

  $pixbuf->save ($base.'.png', 'png');
}

__END__



Good luck,
zentara

-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to