Changeset 13657

Show
Ignore:
Timestamp:
02/01/08 16:43:10 (3 months ago)
Author:
warmerdam
Message:

added JPEG Compressed YCbCr TIFF testing (#2189)

Files:

Legend:

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

    r13410 r13657  
    364364    return ut.testCreateCopy() 
    365365 
     366############################################################################### 
     367# Read JPEG Compressed YCbCr subsampled image.  
     368 
     369def tiff_write_12(): 
     370 
     371    drv = gdal.GetDriverByName( 'GTiff' ) 
     372    md = drv.GetMetadata() 
     373    if string.find(md['DMD_CREATIONOPTIONLIST'],'JPEG') == -1: 
     374        return 'skip' 
     375     
     376    ut = gdaltest.GDALTest( 'GTiff', 'sasha.tif', 3, 31952 ) 
     377                            
     378    return ut.testOpen() 
     379 
     380############################################################################### 
     381# Write JPEG Compressed YCbCr subsampled image.  
     382 
     383def tiff_write_13(): 
     384 
     385    drv = gdal.GetDriverByName( 'GTiff' ) 
     386    md = drv.GetMetadata() 
     387    if string.find(md['DMD_CREATIONOPTIONLIST'],'JPEG') == -1: 
     388        return 'skip' 
     389 
     390    ut = gdaltest.GDALTest( 'GTiff', 'sasha.tif', 3, 17255, 
     391                            options = [ 'TILED=YES', 
     392                                        'COMPRESS=JPEG', 
     393                                        'PHOTOMETRIC=YCBCR', 
     394                                        'JPEG_QUALITY=31' ] ) 
     395                            
     396    return ut.testCreateCopy( skip_preclose_test=1 ) 
     397 
    366398def tiff_write_cleanup(): 
    367399    gdaltest.tiff_drv = None 
     
    381413    tiff_write_10, 
    382414    tiff_write_11, 
     415    tiff_write_12, 
     416    tiff_write_13, 
    383417    tiff_write_cleanup ] 
    384418 
  • trunk/autotest/pymod/gdaltest.py

    r13620 r13657  
    340340 
    341341    def testCreateCopy(self, check_minmax = 1, check_gt = 0, check_srs = None, 
    342                        vsimem = 0, new_filename = None, strict_in = 0 ): 
     342                       vsimem = 0, new_filename = None, strict_in = 0, 
     343                       skip_preclose_test = 0 ): 
     344 
    343345        if self.testDriver() == 'fail': 
    344346            return 'skip' 
     
    367369            return 'fail' 
    368370 
    369         if self.band > 0
     371        if self.band > 0 and skip_preclose_test == 0
    370372            bnd = new_ds.GetRasterBand(self.band) 
    371373            if self.chksum is not None and bnd.Checksum() != self.chksum: 
     
    395397            bnd = new_ds.GetRasterBand(self.band) 
    396398            if self.chksum is not None and bnd.Checksum() != self.chksum: 
    397                 post_reason( 'Did not get expected checksum on reopened file.' ) 
    398                 return 'fail' 
     399                post_reason( 'Did not get expected checksum on reopened file.\n' 
     400                             '    Got %d instead of %d.' \ 
     401                             % (bnd.Checksum(), self.chksum) ) 
     402                return 'fail' 
     403             
    399404            got_minmax = bnd.ComputeRasterMinMax() 
    400405            if got_minmax != minmax and check_minmax: