Simplify MSB-ordered image check

This commit is contained in:
Kleis Auke Wolthuizen 2020-11-23 14:35:03 +01:00
parent 9bb86119e3
commit d9dec2c027

View File

@ -354,7 +354,7 @@ vips__read_header_bytes( VipsImage *im, unsigned char *from )
/* We need to swap for other fields if the file byte order is
* different from ours.
*/
swap = vips_amiMSBfirst() != (im->magic == VIPS_MAGIC_SPARC);
swap = vips_amiMSBfirst() != vips_image_isMSBfirst( im );
for( i = 0; i < VIPS_NUMBER( fields ); i++ ) {
fields[i].copy( swap,
@ -435,7 +435,7 @@ vips__write_header_bytes( VipsImage *im, unsigned char *to )
/* Swap if the byte order we are asked to write the header in is
* different from ours.
*/
gboolean swap = vips_amiMSBfirst() != (im->magic == VIPS_MAGIC_SPARC);
gboolean swap = vips_amiMSBfirst() != vips_image_isMSBfirst( im );
int i;
unsigned char *q;