Changeset 14407

Show
Ignore:
Timestamp:
05/09/08 08:15:23 (3 months ago)
Author:
rouault
Message:

Add test for writing pixel interleaved TIFF with GTiffOddBitsBand

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/autotest/gcore/tiff_write.py

    r14264 r14407  
    584584        pass 
    585585     
     586    return 'success' 
     587 
     588############################################################################### 
     589# Test the write of a pixel-interleaved image with NBITS = 7 
     590 
     591def tiff_write_19(): 
     592 
     593    src_ds = gdal.Open( 'data/contig_strip.tif' ) 
     594 
     595    new_ds = gdaltest.tiff_drv.CreateCopy( 'tmp/contig_strip_7.tif', src_ds, 
     596                                           options = [ 'NBITS=7', 'INTERLEAVE=PIXEL' ] ) 
     597 
     598    new_ds = None 
     599 
     600    # hopefully it's closed now! 
     601 
     602    new_ds = gdal.Open( 'tmp/contig_strip_7.tif' ) 
     603    if new_ds.GetRasterBand(1).Checksum() != src_ds.GetRasterBand(1).Checksum() or \ 
     604       new_ds.GetRasterBand(2).Checksum() != src_ds.GetRasterBand(2).Checksum() or \ 
     605       new_ds.GetRasterBand(3).Checksum() != src_ds.GetRasterBand(3).Checksum() : 
     606        gdaltest.post_reason( 'Didnt get expected checksum on reopened file') 
     607        return 'false' 
     608 
     609    new_ds = None 
     610    src_ds = None 
     611 
     612    gdaltest.tiff_drv.Delete( 'tmp/contig_strip_7.tif' ) 
     613 
    586614    return 'success' 
    587615 
     
    610638    tiff_write_17, 
    611639    tiff_write_18, 
     640    tiff_write_19, 
    612641    tiff_write_cleanup ] 
    613642