fix labq sparc read

byteswap was swapping coded images, or trying to
This commit is contained in:
John Cupitt 2016-01-27 12:44:36 +00:00
parent add75f235f
commit e4b31dde38
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,6 @@
27/1/16 started 8.2.3
- fix a crash with SPARC byte-order labq vips images
12/1/16 started 8.2.2 12/1/16 started 8.2.2
- changes to ease compiling C++ binding with MSVC [Lovell Fuller] - changes to ease compiling C++ binding with MSVC [Lovell Fuller]
- reorder file tests to put slow loaders last - reorder file tests to put slow loaders last

View File

@ -2,6 +2,8 @@
* *
* 5/6/15 * 5/6/15
* - from copy.c * - from copy.c
* 27/1/16
* - don't swap coded images
*/ */
/* /*
@ -137,6 +139,8 @@ vips_byteswap_gen( VipsRegion *or,
int y; int y;
g_assert( swap );
if( vips_region_prepare( ir, r ) ) if( vips_region_prepare( ir, r ) )
return( -1 ); return( -1 );
@ -159,6 +163,12 @@ vips_byteswap_build( VipsObject *object )
if( VIPS_OBJECT_CLASS( vips_byteswap_parent_class )->build( object ) ) if( VIPS_OBJECT_CLASS( vips_byteswap_parent_class )->build( object ) )
return( -1 ); return( -1 );
/* Lots of images don't need swapping.
*/
if( byteswap->in->Coding != VIPS_CODING_NONE ||
!vips_byteswap_swap_fn[byteswap->in->BandFmt] )
return( vips_image_write( byteswap->in, conversion->out ) );
if( vips_image_pio_input( byteswap->in ) ) if( vips_image_pio_input( byteswap->in ) )
return( -1 ); return( -1 );