add "page-height" save property

This commit is contained in:
John Cupitt 2017-06-19 09:31:49 +01:00
parent 882c686553
commit 91457e455a
4 changed files with 20 additions and 0 deletions

View File

@ -8,6 +8,7 @@
- add FORCE resize mode to break aspect ratio
- add vips_thumbnail_image()
- better prefix guessing on Windows, thanks tumagonx
- savers support a "page_height" option for multipage save
12/6/17 started 8.5.7
- transform cmyk->rgb automatically on write if there's an embedded profile

View File

@ -16,6 +16,8 @@
* - remove max-alpha stuff, this is now automatic
* 12/6/17
* - transform cmyk->rgb if there's an embedded profile
* 16/6/17
* - add page_height
*/
/*
@ -1485,6 +1487,10 @@ vips_foreign_save_build( VipsObject *object )
save->background ) )
return( -1 );
if( save->page_height )
vips_image_set_int( ready,
VIPS_META_PAGE_HEIGHT, save->page_height );
VIPS_UNREF( save->ready );
save->ready = ready;
}
@ -1570,6 +1576,13 @@ vips_foreign_save_class_init( VipsForeignSaveClass *class )
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSave, background ),
VIPS_TYPE_ARRAY_DOUBLE );
VIPS_ARG_INT( class, "page_height", 8,
_( "Page height" ),
_( "Set page height for multipage save" ),
VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSave, page_height ),
0, VIPS_MAX_COORD, 0 );
}
static void

View File

@ -472,6 +472,7 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer )
* * @bigtiff: set %TRUE to write a BigTiff file
* * @properties: set %TRUE to write an IMAGEDESCRIPTION tag
* * @strip: set %TRUE to block metadata save
* * @page_height: %gint for page height for multi-page save
*
* Write a VIPS image to a file as TIFF.
*
@ -587,6 +588,7 @@ vips_tiffsave( VipsImage *in, const char *filename, ... )
* * @bigtiff: set %TRUE to write a BigTiff file
* * @properties: set %TRUE to write an IMAGEDESCRIPTION tag
* * @strip: set %TRUE to block metadata save
* * @page_height: %gint for page height for multi-page save
*
* As vips_tiffsave(), but save to a memory buffer.
*

View File

@ -279,6 +279,10 @@ typedef struct _VipsForeignSave {
*/
VipsArrayDouble *background;
/* Set to non-zero to set the page size for multi-page save.
*/
int page_height;
/*< public >*/
/* The image we are to save, as supplied by our caller.