Added method to set the gif properties of the image.
This commit is contained in:
parent
8f4179f496
commit
7072c85e4e
@ -1035,6 +1035,23 @@ write_new( VipsImage *im, const char *filename, const char *format )
|
||||
|
||||
#ifdef HAVE_MAGICK7
|
||||
|
||||
static int
|
||||
magick_set_properties( Write *write )
|
||||
{
|
||||
int number;
|
||||
const char *str;
|
||||
|
||||
if( !vips_image_get_int( write->im, "gif-delay", &number ) )
|
||||
write->current_image->delay = (size_t) number;
|
||||
|
||||
if( !vips_image_get_int( write->im, "gif-loop", &number ) )
|
||||
write->current_image->iterations = (size_t) number;
|
||||
|
||||
if( !vips_image_get_string( write->im, "gif-comment", &str ) )
|
||||
(void) SetImageProperty( write->current_image, "comment",
|
||||
str, write->exception );
|
||||
}
|
||||
|
||||
static int
|
||||
magick_write_block( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
@ -1076,6 +1093,7 @@ magick_create_image( Write *write, VipsImage *im )
|
||||
return( -1 );
|
||||
|
||||
write->current_image=image;
|
||||
magick_set_properties( write );
|
||||
return( vips_sink_disc( im, magick_write_block, write ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user