--- cfmaps/cfmap2png 2006/02/03 07:11:52 1.19 +++ cfmaps/cfmap2png 2007/02/14 02:33:47 1.21 @@ -1,7 +1,7 @@ #!/opt/bin/perl # cfarch2png - convert crossfire maps to png+metadata -# Copyright (C) 2005 Marc Lehmann +# Copyright (C) 2005,2007 Marc Lehmann # # CFARCH2PNG is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ # ... i believe that anytime, but it still doesn't mention the smoothlevel # interaction :( -our $VERSION = '1.21'; +our $VERSION = '1.211'; use strict; @@ -55,7 +55,7 @@ } or do { my %pak; - open my $fh, "<:raw", $path + open my $fh, "<:raw:perlio", $path or die "$_[0]: $!"; while (<$fh>) { my ($type, $id, $len, $path) = split; @@ -78,7 +78,7 @@ } or do { my %smooth; - open my $fh, "<:raw", $path + open my $fh, "<:raw:perlio", $path or die "$path: $!"; while (<$fh>) { next if /^\s*($|#)/; @@ -104,7 +104,7 @@ my %arc; my ($more, $prev); - open my $fh, "<:raw", $path + open my $fh, "<:utf8", $path or die "$path: $!"; my $parse_block; $parse_block = sub { @@ -387,9 +387,10 @@ for my $file (@ARGV) { my $mapa = read_arch $file; + $file =~ s/\.map$//; my ($pb, $meta) = cfmap_render $mapa, $file; $pb->save ("$file.png~~", "png"); - system "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; + system "gm", "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~~", "$file.png~"; # system "pngnq <\Q$file.png~\E >\Q$file.png\E";