the way convert jpg file to Tiled Multi-Resolution TIFF like this,
VipsImage *in;
const char * srcfile = "testimg.jpg";
if (!(in = vips_image_new_from_file(srcfile, NULL))){
printf("\n");
}
im_vips2tiff(in, "res.tiff");
can only get one level tiff ,what is the right way?
Hello @xiangbeihai521,
You need to enable pyramid write. Try:
/* compile with
*
* gcc -g -Wall pyrwrite.c `pkg-config vips --cflags --libs`
*/
#include <vips/vips.h>
int
main( int argc, char **argv )
{
VipsImage *im;
if( VIPS_INIT( argv[0] ) )
vips_error_exit( NULL );
if( !(im = vips_image_new_from_file( argv[1],
"access", VIPS_ACCESS_SEQUENTIAL,
NULL )) )
vips_error_exit( NULL );
if( vips_image_write_to_file( im, argv[2],
"compression", VIPS_FOREIGN_TIFF_COMPRESSION_JPEG,
"pyramid", TRUE,
"tile", TRUE,
NULL ) )
vips_error_exit( NULL );
g_object_unref( im );
return( 0 );
}
thanks