[Tilesathome] tilesathome rmtree issue on Windows
Knut Arne Bjørndal
bob+osm at cakebox.net
Wed Sep 3 17:22:40 BST 2008
On Wed, Sep 03, 2008 at 03:09:26PM +0100, Ed Loach wrote:
> Rmtree in method cleanup in tileset.pm (line 765 in the version I have here) fails on Windows (at least on the Vista and XP machines I've tried here) because the split_*.png files are locked until the client exits.
>
> I've used ProcessMonitor to try and work out what is happening. Inkscape is creating the files and closing them. Perl is then reading the file and not closing it.
>
> Looking at the Perl code, I'm wondering about svg2png, and in particular the last line
>
> return ($FullSplitPngFile, ""); #return success
>
> The comments at the top of the method suggest that the first parameter should be 0 or 1. I don't know Perl (as I'm sure I'll say many times) but it looks like we're at least returning the file name (with path), or perhaps even the file itself (which might explain why ProcessMonitor shows the file being read and not closed?).
The comment is misleading. $FullSplitPngFile is only a string with the
filename, svg2png does not open the file at all.
The only place I can see it being read by perl is in splitImageX where
it does my $Image = newFromPng GD::Image($File);
The GD documentation leads me to believe that this should be the same
as doing the following:
open(PNG, $File) || die;
$Image = newFromPng GD::Image(\*PNG) || die;
close(PNG) || die
You might want to try substituting the latter line with this and see
if it works.
--
Knut Arne Bjørndal
aka Bob Kåre
bob+osm at cakebox.net
bobkare at irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4167 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20080903/4de51601/attachment.bin>
More information about the Tilesathome
mailing list