| | 1486 | |
|---|
| | 1487 | return 'success' |
|---|
| | 1488 | |
|---|
| | 1489 | ############################################################################### |
|---|
| | 1490 | # Test #2457 |
|---|
| | 1491 | |
|---|
| | 1492 | def tiff_write_47(): |
|---|
| | 1493 | |
|---|
| | 1494 | oldSize = gdal.GetCacheMax() |
|---|
| | 1495 | gdal.SetCacheMax(0) |
|---|
| | 1496 | |
|---|
| | 1497 | ret = tiff_write_3() |
|---|
| | 1498 | |
|---|
| | 1499 | gdal.SetCacheMax(oldSize) |
|---|
| | 1500 | return ret |
|---|
| | 1501 | |
|---|
| | 1502 | |
|---|
| | 1503 | ############################################################################### |
|---|
| | 1504 | # Test #2457 with nYOff of RasterIO not aligned on the block height |
|---|
| | 1505 | |
|---|
| | 1506 | def tiff_write_48(): |
|---|
| | 1507 | |
|---|
| | 1508 | drv = gdal.GetDriverByName( 'GTiff' ) |
|---|
| | 1509 | |
|---|
| | 1510 | oldSize = gdal.GetCacheMax() |
|---|
| | 1511 | gdal.SetCacheMax(0) |
|---|
| | 1512 | |
|---|
| | 1513 | src_ds = gdal.Open( 'data/utmsmall.tif' ) |
|---|
| | 1514 | new_ds = gdal.GetDriverByName("GTiff").Create('tmp/tiff_write_48.tif', 100, 100, 1, options = [ 'TILED=YES', 'BLOCKXSIZE=96', 'BLOCKYSIZE=96' ]) |
|---|
| | 1515 | data = src_ds.ReadRaster(0, 0, 100, 1) |
|---|
| | 1516 | data2 = src_ds.ReadRaster(0, 1, 100, 99) |
|---|
| | 1517 | new_ds.WriteRaster(0, 1, 100, 99, data2) |
|---|
| | 1518 | new_ds.WriteRaster(0, 0, 100, 1, data) |
|---|
| | 1519 | new_ds = None |
|---|
| | 1520 | |
|---|
| | 1521 | gdal.SetCacheMax(oldSize) |
|---|
| | 1522 | |
|---|
| | 1523 | new_ds = None |
|---|
| | 1524 | new_ds = gdal.Open('tmp/tiff_write_48.tif') |
|---|
| | 1525 | if new_ds.GetRasterBand(1).Checksum() != 50054: |
|---|
| | 1526 | gdaltest.post_reason( 'Didnt get expected checksum ') |
|---|
| | 1527 | return 'fail' |
|---|
| | 1528 | |
|---|
| | 1529 | new_ds = None |
|---|
| | 1530 | |
|---|
| | 1531 | drv.Delete( 'tmp/tiff_write_48.tif' ) |
|---|