Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Youssefi
otb
Commits
4c7007df
Commit
4c7007df
authored
Jul 07, 2020
by
Cédric Traizet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: complex images can have two times the number of bands in their metadata
parent
91d5a732
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
+8
-5
No files found.
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
View file @
4c7007df
...
...
@@ -1306,12 +1306,15 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
}
m_Imd
.
Bands
=
bandRangeMetadata
;
}
std
::
cout
<<
m_Imd
<<
std
::
endl
;
if
(
!
m_Imd
.
Bands
.
empty
()
&&
(
std
::
size_t
)
m_NbBands
!=
m_Imd
.
Bands
.
size
())
{
itkExceptionMacro
(
<<
"Number of bands in metadata inconsistent with actual image."
);
}
// TODO : this should be a warning instead of an exception
// For complex pixels the number of bands is twice the number of compnents (in GDAL sense)
if
(
!
m_Imd
.
Bands
.
empty
()
&&
static_cast
<
std
::
size_t
>
(
m_NbBands
)
!=
m_Imd
.
Bands
.
size
()
&&
!
((
m_Imd
.
Bands
.
size
()
==
static_cast
<
std
::
size_t
>
(
2
*
m_NbBands
))
&&
this
->
GetPixelType
()
==
COMPLEX
))
{
itkExceptionMacro
(
<<
"Number of bands in metadata inconsistent with actual image."
);
}
if
((
m_Dimensions
[
0
]
==
0
)
&&
(
m_Dimensions
[
1
]
==
0
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment