Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Youssefi
otb
Commits
9e7931d8
Commit
9e7931d8
authored
Jul 02, 2020
by
Julien Osman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG: Copy the maps before iterating over them and modifying them
parent
c24fe741
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Modules/Core/Metadata/src/otbImageMetadata.cxx
Modules/Core/Metadata/src/otbImageMetadata.cxx
+8
-4
No files found.
Modules/Core/Metadata/src/otbImageMetadata.cxx
View file @
9e7931d8
...
...
@@ -477,7 +477,8 @@ void ImageMetadata::compact()
bool
compactVal
;
// TODO Compact the GeometryKeys when comparisons exists
// Compact NumericKeys
for
(
const
auto
&
kv
:
this
->
Bands
.
front
().
NumericKeys
)
auto
numKeys
=
this
->
Bands
.
front
().
NumericKeys
;
for
(
const
auto
&
kv
:
numKeys
)
{
compactVal
=
true
;
auto
bandIt
=
this
->
Bands
.
cbegin
();
...
...
@@ -502,7 +503,8 @@ void ImageMetadata::compact()
}
}
// Compact StringKeys
for
(
const
auto
&
kv
:
this
->
Bands
.
front
().
StringKeys
)
auto
strKeys
=
this
->
Bands
.
front
().
StringKeys
;
for
(
const
auto
&
kv
:
strKeys
)
{
compactVal
=
true
;
auto
bandIt
=
this
->
Bands
.
cbegin
();
...
...
@@ -529,7 +531,8 @@ void ImageMetadata::compact()
// TODO Compact LUT1DKeys when comparisons exists
// TODO Compact LUT2DKeys when comparisons exists
// Compact TimeKeys
for
(
const
auto
&
kv
:
this
->
Bands
.
front
().
TimeKeys
)
auto
timeKeys
=
this
->
Bands
.
front
().
TimeKeys
;
for
(
const
auto
&
kv
:
timeKeys
)
{
compactVal
=
true
;
auto
bandIt
=
this
->
Bands
.
cbegin
();
...
...
@@ -554,7 +557,8 @@ void ImageMetadata::compact()
}
}
// Compact ExtraKeys
for
(
const
auto
&
kv
:
this
->
Bands
.
front
().
ExtraKeys
)
auto
extraKeys
=
this
->
Bands
.
front
().
ExtraKeys
;
for
(
const
auto
&
kv
:
extraKeys
)
{
compactVal
=
true
;
auto
bandIt
=
this
->
Bands
.
cbegin
();
...
...
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