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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
David Youssefi
otb
Commits
ce3cc10a
Commit
ce3cc10a
authored
13 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Fixing bug when number of tiles to decode is not a multiple of number of available threads
parent
2665ed10
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/otbJPEG2000ImageIO.cxx
+21
-0
21 additions, 0 deletions
Code/IO/otbJPEG2000ImageIO.cxx
with
21 additions
and
0 deletions
Code/IO/otbJPEG2000ImageIO.cxx
+
21
−
0
View file @
ce3cc10a
...
...
@@ -711,6 +711,11 @@ void JPEG2000ImageIO::Read(void* buffer)
{
opj_image_t
*
currentTile
=
itTile
->
second
;
if
(
!
currentTile
)
{
itkExceptionMacro
(
<<
"Tile "
<<
itTile
->
first
<<
" needed but not loaded."
);
}
unsigned
int
lWidthSrc
;
// Width of the input pixel in nb of pixel
unsigned
int
lHeightDest
;
// Height of the area where write in nb of pixel
unsigned
int
lWidthDest
;
// Width of the area where write in nb of pixel
...
...
@@ -866,6 +871,22 @@ ITK_THREAD_RETURN_TYPE JPEG2000ImageIO::ThreaderCallback( void *arg )
otbMsgDevMacro
(
<<
" Tile "
<<
tiles
->
at
(
i
).
first
<<
" decoded by thread "
<<
threadId
);
}
unsigned
int
lastTile
=
threadCount
*
tilesPerThread
+
threadId
;
// TODO: check this last part
if
(
lastTile
<
tiles
->
size
())
{
tiles
->
at
(
lastTile
).
second
=
readers
.
at
(
threadId
)
->
DecodeTile
(
tiles
->
at
(
lastTile
).
first
);
if
(
!
tiles
->
at
(
lastTile
).
second
)
{
readers
.
at
(
threadId
)
->
Clean
();
itkGenericExceptionMacro
(
" otbopenjpeg failed to decode the desired tile "
<<
tiles
->
at
(
lastTile
).
first
<<
"!"
);
}
otbMsgDevMacro
(
<<
" Tile "
<<
tiles
->
at
(
lastTile
).
first
<<
" decoded by thread "
<<
threadId
);
}
return
ITK_THREAD_RETURN_VALUE
;
}
...
...
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