add some more ppm tests

This commit is contained in:
John Cupitt 2020-12-26 18:35:11 +00:00
parent b2fa1f89e8
commit 158e9e153a
2 changed files with 21 additions and 0 deletions

View File

@ -41,6 +41,10 @@
* - add ppmload_source
* 22/11/20
* - fix msb_first default [ewelot]
* 26/12/20
* - don't byteswap ascii formats
* - set metadata for map loads
* - byteswap binary loads
*/
/*
@ -705,7 +709,10 @@ vips_foreign_load_ppm_load( VipsForeignLoad *load )
vips_amiMSBfirst() != ppm->msb_first );
#endif /*DEBUG*/
/* Don't byteswap the ascii formats.
*/
if( vips__byteswap_bool( t[0], &t[1],
!ppm->ascii &&
vips_amiMSBfirst() != ppm->msb_first ) ||
vips_image_write( t[1], load->real ) )
return( -1 );

View File

@ -891,6 +891,20 @@ class TestForeign:
self.save_load("%s.ppm", self.mono)
self.save_load("%s.ppm", self.colour)
self.save_load_file("%s.ppm", "[ascii]", self.mono, 0)
self.save_load_file("%s.ppm", "[ascii]", self.colour, 0)
self.save_load_file("%s.ppm", "[ascii,bitdepth=1]", self.onebit, 0)
rgb16 = self.colour.colourspace("rgb16")
grey16 = self.mono.colourspace("rgb16")
self.save_load("%s.ppm", grey16)
self.save_load("%s.ppm", rgb16)
self.save_load_file("%s.ppm", "[ascii]", grey16, 0)
self.save_load_file("%s.ppm", "[ascii]", rgb16, 0)
@skip_if_no("radload")
def test_rad(self):
self.save_load("%s.hdr", self.colour)