I was having a problem with png2tileinfo.pl under windows XP using the 'set' command line option.

Attached is a patch for png2tileinfo.pl and process-changes to resolve the problem.

Can someone with svn access test on linux and commit for me if  that is ok?

Also while I'm on the subject, what's the best way for me to submit oceantiles_12 png/dat changes once I've confirmed it fixes the rendering of the tiles I'm working on?

And lastly, who runs process-changes and how often? If the link it points to is current, it reports 248 changes would be applied. Although looking at the data is contains a few corrupt records and does not seem to have any of the recent changes I tried requesting via the Information Freeway map.

Cheers

rcr



Index: png2tileinfo.pl
===================================================================
--- png2tileinfo.pl     (revision 6208)
+++ png2tileinfo.pl     (working copy)
@@ -57,10 +57,10 @@
 {
   my($image, $x, $y, $type) = @_;
   my $color;
-
-  $color = $image->colorAllocate(0,0,255) if($type == TILETYPE_SEA);
-  $color = $image->colorAllocate(0,255,0) if($type == TILETYPE_LAND);
-  $color = $image->colorAllocate(255,255,255) if($type == TILETYPE_TILE);
+  # Resolve not Allocate as color table appears to be full from previous 
allocates
+  $color = $image->colorResolve(0,0,255) if($type == TILETYPE_SEA);
+  $color = $image->colorResolve(0,255,0) if($type == TILETYPE_LAND);
+  $color = $image->colorResolve(255,255,255) if($type == TILETYPE_TILE);
   $image->setPixel($x,$y, $color);
 }
 
@@ -115,6 +115,8 @@
            set_type($world_im, $x, $y, $newtype);
 
            open $world_fh, ">oceantiles_12.png" or die;
+           # use binmode so it works on windows too
+           binmode $world_fh;
            print $world_fh $world_im->png;
            close $world_fh;
        }
Index: process-changes
===================================================================
--- process-changes     (revision 6208)
+++ process-changes     (working copy)
@@ -131,6 +131,8 @@
 print "Complete: done($done), unnecessary($unnecessary), double($double)\n";
 
 open $world_fh, ">oceantiles_12.png" or die;
+# use binmode so it works on windows too
+binmode $world_fh;
 print $world_fh $world_im->png;
 close $world_fh;
 
_______________________________________________
Tilesathome mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/tilesathome

Reply via email to