Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
e1bd1f33
Commit
e1bd1f33
authored
10 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: OTB-638: get the error message from GDAL and add it to the itk::Exception message
parent
9781e275
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/IO/otbGDALImageIO.cxx
+10
-5
10 additions, 5 deletions
Code/IO/otbGDALImageIO.cxx
with
10 additions
and
5 deletions
Code/IO/otbGDALImageIO.cxx
+
10
−
5
View file @
e1bd1f33
...
...
@@ -354,7 +354,8 @@ void GDALImageIO::Read(void* buffer)
0
);
if
(
lCrGdal
==
CE_Failure
)
{
itkExceptionMacro
(
<<
"Error while reading image (GDAL format) "
<<
m_FileName
.
c_str
()
<<
"."
);
itkExceptionMacro
(
<<
"Error while reading image (GDAL format) '"
<<
m_FileName
.
c_str
()
<<
"' : "
<<
CPLGetLastErrorMsg
());
}
// Interpret index as color
std
::
streamoff
cpt
(
0
);
...
...
@@ -424,7 +425,8 @@ void GDALImageIO::Read(void* buffer)
// Check if gdal call succeed
if
(
lCrGdal
==
CE_Failure
)
{
itkExceptionMacro
(
<<
"Error while reading image (GDAL format) "
<<
m_FileName
.
c_str
()
<<
"."
);
itkExceptionMacro
(
<<
"Error while reading image (GDAL format) '"
<<
m_FileName
.
c_str
()
<<
"' : "
<<
CPLGetLastErrorMsg
());
return
;
}
//printDataBuffer(p, m_PxType->pixType, m_NbBands, lNbColumnsRegion*lNbLinesRegion);
...
...
@@ -1340,7 +1342,8 @@ void GDALImageIO::Write(const void* buffer)
// Check if writing succeed
if
(
lCrGdal
==
CE_Failure
)
{
itkExceptionMacro
(
<<
"Error while writing image (GDAL format) "
<<
m_FileName
.
c_str
()
<<
"."
);
itkExceptionMacro
(
<<
"Error while writing image (GDAL format) '"
<<
m_FileName
.
c_str
()
<<
"' : "
<<
CPLGetLastErrorMsg
());
}
// Flush dataset cache
m_Dataset
->
GetDataSet
()
->
FlushCache
();
...
...
@@ -1364,7 +1367,8 @@ void GDALImageIO::Write(const void* buffer)
NULL
,
NULL
);
if
(
!
hOutputDS
)
{
itkExceptionMacro
(
<<
"Error while writing image (GDAL format) "
<<
m_FileName
.
c_str
()
<<
"."
);
itkExceptionMacro
(
<<
"Error while writing image (GDAL format) '"
<<
m_FileName
.
c_str
()
<<
"' : "
<<
CPLGetLastErrorMsg
());
}
else
{
...
...
@@ -1586,7 +1590,8 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
if
(
m_Dataset
.
IsNull
())
{
itkExceptionMacro
(
<<
"GDAL Writing failed : Impossible to create the image file name '"
<<
m_FileName
<<
"'."
);
<<
"GDAL Writing failed : Impossible to create the image file name '"
<<
m_FileName
<<
"' : "
<<
CPLGetLastErrorMsg
()
);
}
/*----------------------------------------------------------------------*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment