ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfmap2png
(Generate patch)

Comparing cfmaps/cfmap2png (file contents):
Revision 1.20 by root, Sat Sep 16 18:39:10 2006 UTC vs.
Revision 1.21 by root, Wed Feb 14 02:33:47 2007 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3# cfarch2png - convert crossfire maps to png+metadata 3# cfarch2png - convert crossfire maps to png+metadata
4# Copyright (C) 2005 Marc Lehmann <gvpe@schmorp.de> 4# Copyright (C) 2005,2007 Marc Lehmann <cfmaps@schmorp.de>
5# 5#
6# CFARCH2PNG is free software; you can redistribute it and/or modify 6# CFARCH2PNG is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by 7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or 8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version. 9# (at your option) any later version.
28# Bottom object: the highest object that is a floor type object. 28# Bottom object: the highest object that is a floor type object.
29# 29#
30# ... i believe that anytime, but it still doesn't mention the smoothlevel 30# ... i believe that anytime, but it still doesn't mention the smoothlevel
31# interaction :( 31# interaction :(
32 32
33our $VERSION = '1.21'; 33our $VERSION = '1.211';
34 34
35use strict; 35use strict;
36 36
37use Storable; 37use Storable;
38use List::Util qw(max); 38use List::Util qw(max);
385 ($map_pb, \%meta) 385 ($map_pb, \%meta)
386} 386}
387 387
388for my $file (@ARGV) { 388for my $file (@ARGV) {
389 my $mapa = read_arch $file; 389 my $mapa = read_arch $file;
390 $file =~ s/\.map$//;
390 my ($pb, $meta) = cfmap_render $mapa, $file; 391 my ($pb, $meta) = cfmap_render $mapa, $file;
391 $pb->save ("$file.png~~", "png"); 392 $pb->save ("$file.png~~", "png");
392 system "gm", "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg"; 393 system "gm", "convert", "$file.png~~", "-filter" => "lanczos", "-geometry" => "3.125%", "-quality" => 85, "$file.jpg";
393 #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency 394 #system "mogrify", "-colors" => 65536, "$file.png~"; # destroys transparency
394 system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~~", "$file.png~"; 395 system "pngcrush", "-q", "-m" => 7, "-rem", "alla", "-cc", "-reduce", "$file.png~~", "$file.png~";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines