fix png save

This commit is contained in:
John Cupitt 2012-02-14 10:53:39 +00:00
parent 71d55c4554
commit 07cf2be29e
2 changed files with 17 additions and 4 deletions

11
TODO
View File

@ -9,9 +9,7 @@
`gdouble' is invalid or out of range for property `yres' of
type `gdouble'
- png save from nip2 often makes bad pngs?
and clicking on one of those bad pngs in the file browser will lock nip2
- clicking on bad pngs in the file browser will lock nip2
they don't seem to bother "header" though, strange
@ -44,6 +42,13 @@
total of about 0.5s user time difference
... tile size difference!
try
time ./vips.py wtc_tiled_small.tif x.tif --vips-tile-width=512
--vips-tile-height=512

View File

@ -513,13 +513,19 @@ typedef struct {
} Write;
static void
write_destroy( VipsImage *out, Write *write )
write_finish( Write *write )
{
VIPS_FREEF( fclose, write->fp );
if( write->pPng )
png_destroy_write_struct( &write->pPng, &write->pInfo );
}
static void
write_destroy( VipsImage *out, Write *write )
{
write_finish( write );
}
static Write *
write_new( VipsImage *in )
{
@ -690,6 +696,8 @@ vips__png_write( VipsImage *in, const char *filename,
return( -1 );
}
write_finish( write );
return( 0 );
}