2019-08-04 18:43:35 +02:00
|
|
|
/* compile with:
|
2015-01-30 22:19:58 +01:00
|
|
|
*
|
|
|
|
* g++ -g -Wall resize.cpp `pkg-config vips-cpp --cflags --libs`
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <vips/vips8>
|
|
|
|
|
|
|
|
using namespace vips;
|
|
|
|
|
|
|
|
int
|
|
|
|
main( int argc, char **argv )
|
|
|
|
{
|
2019-08-04 18:43:35 +02:00
|
|
|
if( VIPS_INIT( argv[0] ) )
|
2015-01-30 22:19:58 +01:00
|
|
|
vips_error_exit( NULL );
|
|
|
|
|
2019-08-04 18:43:35 +02:00
|
|
|
VImage in = VImage::new_from_file( argv[1], VImage::option()
|
|
|
|
->set( "access", "sequential" ) );
|
2015-01-30 22:19:58 +01:00
|
|
|
|
2019-08-04 18:43:35 +02:00
|
|
|
VImage out = in.resize( 0.2, VImage::option()
|
|
|
|
->set( "kernel", "cubic" )
|
|
|
|
->set( "vscale", 0.2 ) );
|
2015-01-30 22:19:58 +01:00
|
|
|
|
|
|
|
out.write_to_file( argv[2] );
|
|
|
|
|
|
|
|
vips_shutdown();
|
|
|
|
|
|
|
|
return( 0 );
|
|
|
|
}
|