Opened 8 years ago
Closed 8 years ago
#6290 closed defect (fixed)
About GDAL VRT format bug
Reported by: | liminlu0314 | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.4 |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | Raster VRT CPLScanUIntBig bug |
Cc: |
Description
I create a VRT file (named Test.vrt) using gdaltest.cpp, but the opened image is wrong. The ImageOffset of the second band is 11659482, while the true value should be 11659458.
In the AddBand function in the vrtdataset.cpp file,the code around line 907 is as below:
/* -------------------------------------------------------------------- */ /* Collect required information. */ /* -------------------------------------------------------------------- */ vsi_l_offset nImageOffset = 0; if( CSLFetchNameValue(papszOptions, "ImageOffset") != NULL ) nImageOffset = CPLScanUIntBig( CSLFetchNameValue(papszOptions, "ImageOffset"), 20);
In the CPLScanUIntBig function, the size of ImageOffset is set to be 20, which should be changed into 22 to make it right.
Test.vrt and gdaltest.cpp can be found in attatchment. Another attatchment is tm.mdd, which is a Raw file, and can be replaced with any Raw file. debuginfo.png is a debug info.
Attachments (3)
Change History (4)
by , 8 years ago
Attachment: | gdaltest.cpp added |
---|
by , 8 years ago
by , 8 years ago
Attachment: | debuginfo.png added |
---|
comment:1 by , 8 years ago
Milestone: | → 1.11.4 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed a bit differently:
trunk r32755, branches/2.0 r32756, branches/1.11 r32757 "VRT raw: don't truncate last figure of ImageOffset if there are left space padding (#6290)"
c++ code file