"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/vipsedit.c" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

vipsedit.c  (vips-8.10.6):vipsedit.c  (vips-8.11.0)
skipping to change at line 144 skipping to change at line 144
unsigned char header[VIPS_SIZEOF_HEADER]; unsigned char header[VIPS_SIZEOF_HEADER];
if( VIPS_INIT( argv[0] ) ) if( VIPS_INIT( argv[0] ) )
vips_error_exit( "%s", _( "unable to start VIPS" ) ); vips_error_exit( "%s", _( "unable to start VIPS" ) );
textdomain( GETTEXT_PACKAGE ); textdomain( GETTEXT_PACKAGE );
setlocale( LC_ALL, "" ); setlocale( LC_ALL, "" );
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of /* On Windows, argv is ascii-only .. use this to get a utf-8 version of
* the args. * the args.
*/ */
#ifdef HAVE_G_WIN32_GET_COMMAND_LINE #ifdef G_OS_WIN32
argv = g_win32_get_command_line(); argv = g_win32_get_command_line();
#endif /*HAVE_G_WIN32_GET_COMMAND_LINE*/ #endif /*G_OS_WIN32*/
context = g_option_context_new( context = g_option_context_new(
_( "vipsedit - edit vips file header" ) ); _( "vipsedit - edit vips file header" ) );
main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL );
g_option_group_add_entries( main_group, entries ); g_option_group_add_entries( main_group, entries );
vips_add_option_entries( main_group ); vips_add_option_entries( main_group );
g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE ); g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE );
g_option_context_set_main_group( context, main_group ); g_option_context_set_main_group( context, main_group );
#ifdef HAVE_G_WIN32_GET_COMMAND_LINE #ifdef G_OS_WIN32
if( !g_option_context_parse_strv( context, &argv, &error ) ) if( !g_option_context_parse_strv( context, &argv, &error ) )
#else /*!HAVE_G_WIN32_GET_COMMAND_LINE*/ #else /*!G_OS_WIN32*/
if( !g_option_context_parse( context, &argc, &argv, &error ) ) if( !g_option_context_parse( context, &argc, &argv, &error ) )
#endif /*HAVE_G_WIN32_GET_COMMAND_LINE*/ #endif /*G_OS_WIN32*/
{ {
vips_g_error( &error ); vips_g_error( &error );
exit( -1 ); exit( -1 );
} }
/* On Windows, argc will not have been updated by /* On Windows, argc will not have been updated by
* g_option_context_parse_strv(). * g_option_context_parse_strv().
*/ */
for( argc = 0; argv[argc]; argc++ ) for( argc = 0; argv[argc]; argc++ )
; ;
if( argc != 2 ) { if( argc != 2 ) {
fprintf( stderr, _( "usage: %s [OPTION...] vips-file\n" ), fprintf( stderr, _( "usage: %s [OPTION...] vips-file\n" ),
g_get_prgname() ); g_get_prgname() );
exit( -1 ); exit( -1 );
} }
if( !(im = vips_image_new_from_file( argv[1], NULL )) ) if( !(im = vips_image_new_from_file( argv[1], NULL )) )
vips_error_exit( _( "could not open image %s" ), argv[1] ); vips_error_exit( _( "could not open image %s" ), argv[1] );
vips__seek( im->fd, 0, SEEK_SET ); vips__seek( im->fd, 0, SEEK_SET );
if( read( im->fd, header, VIPS_SIZEOF_HEADER ) != if( read( im->fd, header, VIPS_SIZEOF_HEADER ) !=
VIPS_SIZEOF_HEADER || VIPS_SIZEOF_HEADER ||
vips__read_header_bytes( im, header ) ) vips__read_header_bytes( im, header ) )
skipping to change at line 272 skipping to change at line 273
while( size > 0 && isspace( xml[size - 1] ) ) while( size > 0 && isspace( xml[size - 1] ) )
size -= 1; size -= 1;
if( vips__write_extension_block( im, xml, size ) ) if( vips__write_extension_block( im, xml, size ) )
vips_error_exit( "%s", _( "could not set extension" ) ); vips_error_exit( "%s", _( "could not set extension" ) );
g_free( xml ); g_free( xml );
} }
g_object_unref( im ); g_object_unref( im );
/* We don't free this on error exit, sadly. g_option_context_free( context );
*/
#ifdef HAVE_G_WIN32_GET_COMMAND_LINE #ifdef G_OS_WIN32
g_strfreev( argv ); g_strfreev( argv );
#endif /*HAVE_G_WIN32_GET_COMMAND_LINE*/ #endif /*G_OS_WIN32*/
vips_shutdown(); vips_shutdown();
return( 0 ); return( 0 );
} }
 End of changes. 8 change blocks. 
9 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)