Changeset 11744
- Timestamp:
- 07/12/07 11:40:19 (1 year ago)
- Files:
-
- trunk/gdal/frmts/gtiff/geotiff.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/frmts/gtiff/geotiff.cpp
r11699 r11744 76 76 TIFF *hTIFF; 77 77 78 uint32nDirOffset;78 toff_t nDirOffset; 79 79 int bBase; 80 80 … … 114 114 115 115 void WriteGeoTIFFInfo(); 116 int SetDirectory( uint32nDirOffset = 0 );116 int SetDirectory( toff_t nDirOffset = 0 ); 117 117 void SetupTFW(const char *pszBasename); 118 118 … … 151 151 GDALProgressFunc, void * ); 152 152 153 CPLErr OpenOffset( TIFF *, uint32nDirOffset, int, GDALAccess );153 CPLErr OpenOffset( TIFF *, toff_t nDirOffset, int, GDALAccess ); 154 154 155 155 static GDALDataset *OpenDir( const char *pszFilename ); … … 531 531 /************************************************************************/ 532 532 /* IWriteBlock() */ 533 /* */534 /* This is still limited to writing stripped datasets. */535 533 /************************************************************************/ 536 534 … … 1912 1910 1913 1911 { 1914 uint32*panByteCounts = NULL;1912 toff_t *panByteCounts = NULL; 1915 1913 1916 1914 if( ( TIFFIsTiled( hTIFF ) … … 2562 2560 /************************************************************************/ 2563 2561 2564 int GTiffDataset::SetDirectory( uint32nNewOffset )2562 int GTiffDataset::SetDirectory( toff_t nNewOffset ) 2565 2563 2566 2564 { … … 2607 2605 return FALSE; 2608 2606 2607 #ifndef BIGTIFF_SUPPORT 2609 2608 if( poOpenInfo->pabyHeader[2] == 43 && poOpenInfo->pabyHeader[3] == 0 ) 2610 2609 { … … 2614 2613 return FALSE; 2615 2614 } 2615 #endif 2616 2616 2617 2617 if( (poOpenInfo->pabyHeader[2] != 0x2A || poOpenInfo->pabyHeader[3] != 0) 2618 && (poOpenInfo->pabyHeader[3] != 0x2A || poOpenInfo->pabyHeader[2] != 0) ) 2618 && (poOpenInfo->pabyHeader[3] != 0x2A || poOpenInfo->pabyHeader[2] != 0) 2619 && (poOpenInfo->pabyHeader[2] != 0x2B || poOpenInfo->pabyHeader[3] != 0) 2620 && (poOpenInfo->pabyHeader[3] != 0x2B || poOpenInfo->pabyHeader[2] != 0)) 2619 2621 return FALSE; 2620 2622 … … 2649 2651 return NULL; 2650 2652 2653 #ifndef BIGTIFF_SUPPORT 2651 2654 if( poOpenInfo->pabyHeader[2] == 43 && poOpenInfo->pabyHeader[3] == 0 ) 2652 2655 { … … 2656 2659 return NULL; 2657 2660 } 2661 #endif 2658 2662 2659 2663 if( (poOpenInfo->pabyHeader[2] != 0x2A || poOpenInfo->pabyHeader[3] != 0) 2660 && (poOpenInfo->pabyHeader[3] != 0x2A || poOpenInfo->pabyHeader[2] != 0) ) 2664 && (poOpenInfo->pabyHeader[3] != 0x2A || poOpenInfo->pabyHeader[2] != 0) 2665 && (poOpenInfo->pabyHeader[2] != 0x2B || poOpenInfo->pabyHeader[3] != 0) 2666 && (poOpenInfo->pabyHeader[3] != 0x2B || poOpenInfo->pabyHeader[2] != 0)) 2661 2667 return NULL; 2662 2668 … … 2829 2835 /************************************************************************/ 2830 2836 2831 CPLErr GTiffDataset::OpenOffset( TIFF *hTIFFIn, uint32nDirOffsetIn,2837 CPLErr GTiffDataset::OpenOffset( TIFF *hTIFFIn, toff_t nDirOffsetIn, 2832 2838 int bBaseIn, GDALAccess eAccess ) 2833 2839 … … 3463 3469 const char *pszValue; 3464 3470 const char *pszProfile; 3471 int bCreateBigTIFF = FALSE; 3465 3472 3466 3473 GTiffOneTimeInit(); … … 3567 3574 > 4200000000.0 ) 3568 3575 { 3576 #ifndef BIGTIFF_SUPPORT 3569 3577 CPLError( CE_Failure, CPLE_AppDefined, 3570 3578 "A %d pixels x %d lines x %d bands %s image would be larger than 4GB\n" … … 3572 3580 nXSize, nYSize, nBands, GDALGetDataTypeName(eType) ); 3573 3581 return NULL; 3574 } 3575 } 3582 #else 3583 bCreateBigTIFF = TRUE; 3584 #endif 3585 } 3586 } 3587 3588 /* -------------------------------------------------------------------- */ 3589 /* Create BigTIFF file on user's request, even if total image */ 3590 /* size is enough for ClassicTIFF. */ 3591 /* -------------------------------------------------------------------- */ 3592 #ifdef BIGTIFF_SUPPORT 3593 if( CSLFetchNameValue(papszParmList, "BigTIFF") != NULL ) 3594 bCreateBigTIFF = TRUE; 3595 #endif 3576 3596 3577 3597 /* -------------------------------------------------------------------- */ 3578 3598 /* Try opening the dataset. */ 3579 3599 /* -------------------------------------------------------------------- */ 3580 hTIFF = VSI_TIFFOpen( pszFilename, "w+" );3600 hTIFF = VSI_TIFFOpen( pszFilename, (bCreateBigTIFF) ? "w+8" : "w+" ); 3581 3601 if( hTIFF == NULL ) 3582 3602 { … … 4964 4984 " <Value>GeoTIFF</value>" 4965 4985 " <Value>BASELINE</Value>" 4986 #ifdef BIGTIFF_SUPPORT 4987 " <Option name='BIGTIFF' type='boolean' description='Force creation of BigTIFF file'/>" 4988 #endif 4966 4989 " </Option>" 4967 4990 "</CreationOptionList>" );
