Created
January 15, 2014 09:25
-
-
Save jcupitt/8433220 to your computer and use it in GitHub Desktop.
try repeated save to a buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* compile with | |
* | |
* gcc -g -Wall try207.c `pkg-config vips --cflags --libs` | |
*/ | |
#include <stdio.h> | |
#include <vips/vips.h> | |
int | |
main( int argc, char **argv ) | |
{ | |
VipsImage *im; | |
int i; | |
if( !(im = vips_image_new_from_file( argv[1] )) ) | |
vips_error_exit( "can't open" ); | |
for( i = 0; i < 10; i++ ) { | |
void *buf; | |
size_t len; | |
if( vips_jpegsave_buffer( im, &buf, &len, NULL ) ) | |
vips_error_exit( "save #1 failed" ); | |
printf( "saved %zd bytes to %p\n", len, buf ); | |
g_free( buf ); | |
} | |
g_object_unref( im ); | |
return( 0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment