Merge branch '8.5'
This commit is contained in:
commit
3cf33d7f32
@ -16,6 +16,7 @@
|
|||||||
2/8/17 started 8.5.8
|
2/8/17 started 8.5.8
|
||||||
- fix transparency detection in merge, thanks Haida
|
- fix transparency detection in merge, thanks Haida
|
||||||
- define env var VIPS_WARNING to hide warning messages
|
- define env var VIPS_WARNING to hide warning messages
|
||||||
|
- shut down dzsave output earlier to help mark-sweep bindings
|
||||||
|
|
||||||
9/6/17 started 8.5.7
|
9/6/17 started 8.5.7
|
||||||
- better smartcrop
|
- better smartcrop
|
||||||
|
@ -71,6 +71,8 @@
|
|||||||
* - add dzsave_buffer
|
* - add dzsave_buffer
|
||||||
* 11/11/16 Felix Bünemann
|
* 11/11/16 Felix Bünemann
|
||||||
* - better >4gb detection for zip output on older libgsfs
|
* - better >4gb detection for zip output on older libgsfs
|
||||||
|
* 18/8/17
|
||||||
|
* - shut down the output earlier to flush zip output
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -210,47 +212,28 @@ vips_gsf_tree_close( VipsGsfDirectory *tree )
|
|||||||
vips_slist_map2( tree->children,
|
vips_slist_map2( tree->children,
|
||||||
(VipsSListMap2Fn) vips_gsf_tree_close, NULL, NULL );
|
(VipsSListMap2Fn) vips_gsf_tree_close, NULL, NULL );
|
||||||
|
|
||||||
if( tree->out &&
|
if( tree->out ) {
|
||||||
!gsf_output_is_closed( tree->out ) &&
|
if( !gsf_output_is_closed( tree->out ) &&
|
||||||
!gsf_output_close( tree->out ) ) {
|
!gsf_output_close( tree->out ) ) {
|
||||||
vips_error( "vips_gsf", "%s", _( "unable to close stream" ) );
|
vips_error( "vips_gsf",
|
||||||
return( tree );
|
"%s", _( "unable to close stream" ) );
|
||||||
}
|
return( tree );
|
||||||
if( tree->container &&
|
}
|
||||||
!gsf_output_is_closed( tree->container ) &&
|
|
||||||
!gsf_output_close( tree->container ) ) {
|
|
||||||
vips_error( "vips_gsf", "%s", _( "unable to close stream" ) );
|
|
||||||
return( tree );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( NULL );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Close and unref everything, can't fail. Call vips_gsf_tree_close() to get
|
|
||||||
* an error return.
|
|
||||||
*/
|
|
||||||
static void *
|
|
||||||
vips_gsf_tree_free( VipsGsfDirectory *tree )
|
|
||||||
{
|
|
||||||
vips_slist_map2( tree->children,
|
|
||||||
(VipsSListMap2Fn) vips_gsf_tree_free, NULL, NULL );
|
|
||||||
g_slist_free( tree->children );
|
|
||||||
g_free( (char *) tree->name );
|
|
||||||
|
|
||||||
if( tree->out ) {
|
|
||||||
if( !gsf_output_is_closed( tree->out ) )
|
|
||||||
(void) gsf_output_close( tree->out );
|
|
||||||
g_object_unref( tree->out );
|
g_object_unref( tree->out );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( tree->container ) {
|
if( tree->container ) {
|
||||||
if( !gsf_output_is_closed( tree->container ) )
|
if( !gsf_output_is_closed( tree->container ) &&
|
||||||
(void) gsf_output_close( tree->container );
|
!gsf_output_close( tree->container ) ) {
|
||||||
|
vips_error( "vips_gsf",
|
||||||
|
"%s", _( "unable to close stream" ) );
|
||||||
|
return( tree );
|
||||||
|
}
|
||||||
|
|
||||||
g_object_unref( tree->container );
|
g_object_unref( tree->container );
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free( tree );
|
|
||||||
|
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,7 +545,7 @@ vips_foreign_save_dz_dispose( GObject *gobject )
|
|||||||
VipsForeignSaveDz *dz = (VipsForeignSaveDz *) gobject;
|
VipsForeignSaveDz *dz = (VipsForeignSaveDz *) gobject;
|
||||||
|
|
||||||
VIPS_FREEF( layer_free, dz->layer );
|
VIPS_FREEF( layer_free, dz->layer );
|
||||||
VIPS_FREEF( vips_gsf_tree_free, dz->tree );
|
VIPS_FREEF( vips_gsf_tree_close, dz->tree );
|
||||||
VIPS_FREEF( g_object_unref, dz->out );
|
VIPS_FREEF( g_object_unref, dz->out );
|
||||||
VIPS_FREE( dz->basename );
|
VIPS_FREE( dz->basename );
|
||||||
VIPS_FREE( dz->dirname );
|
VIPS_FREE( dz->dirname );
|
||||||
@ -1912,9 +1895,6 @@ vips_foreign_save_dz_build( VipsObject *object )
|
|||||||
write_vips_meta( dz ) )
|
write_vips_meta( dz ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
if( vips_gsf_tree_close( dz->tree ) )
|
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
/* This is so ugly. In earlier versions of dzsave, we wrote x.dzi and
|
/* This is so ugly. In earlier versions of dzsave, we wrote x.dzi and
|
||||||
* x_files. Now we write x/x.dzi and x/x_files to make it possible to
|
* x_files. Now we write x/x.dzi and x/x_files to make it possible to
|
||||||
* create zip files.
|
* create zip files.
|
||||||
@ -1946,6 +1926,19 @@ vips_foreign_save_dz_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Shut down the output to flush everything.
|
||||||
|
*/
|
||||||
|
if( vips_gsf_tree_close( dz->tree ) )
|
||||||
|
return( -1 );
|
||||||
|
dz->tree = NULL;
|
||||||
|
|
||||||
|
/* If we are writing a zip to the filesystem, we must unref out to
|
||||||
|
* force it to disc.
|
||||||
|
*/
|
||||||
|
if( dz->container == VIPS_FOREIGN_DZ_CONTAINER_ZIP &&
|
||||||
|
dz->dirname != NULL )
|
||||||
|
VIPS_FREEF( g_object_unref, dz->out );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,13 +409,15 @@ class TestCreate(unittest.TestCase):
|
|||||||
self.assertEqual(im.format, Vips.BandFormat.FLOAT)
|
self.assertEqual(im.format, Vips.BandFormat.FLOAT)
|
||||||
|
|
||||||
def test_text(self):
|
def test_text(self):
|
||||||
im = Vips.Image.text("Hello, world!")
|
x = Vips.type_find("VipsOperation", "text")
|
||||||
self.assertTrue(im.width > 10)
|
if x.is_instantiatable():
|
||||||
self.assertTrue(im.height > 10)
|
im = Vips.Image.text("Hello, world!")
|
||||||
self.assertEqual(im.bands, 1)
|
self.assertTrue(im.width > 10)
|
||||||
self.assertEqual(im.format, Vips.BandFormat.UCHAR)
|
self.assertTrue(im.height > 10)
|
||||||
self.assertEqual(im.max(), 255)
|
self.assertEqual(im.bands, 1)
|
||||||
self.assertEqual(im.min(), 0)
|
self.assertEqual(im.format, Vips.BandFormat.UCHAR)
|
||||||
|
self.assertEqual(im.max(), 255)
|
||||||
|
self.assertEqual(im.min(), 0)
|
||||||
|
|
||||||
def test_tonelut(self):
|
def test_tonelut(self):
|
||||||
im = Vips.Image.tonelut()
|
im = Vips.Image.tonelut()
|
||||||
|
Loading…
Reference in New Issue
Block a user