Skip to content

Commit

Permalink
Fix progress count off by one bug.
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Colwell <[email protected]>
  • Loading branch information
acolwell committed Apr 11, 2024
1 parent f43c19a commit 40a14bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libOpenImageIO/imagebuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,8 @@ ImageBuf::write(ImageOutput* out, ProgressCallback progress_callback,
&& progress_callback(
progress_callback_data,
(float)(z * outspec.height
+ (isDecreasingY ? (outspec.height - y) : y))
+ (isDecreasingY ? (outspec.height - 1 - y)
: y))
/ (outspec.height * outspec.depth)))
return ok;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libOpenImageIO/imageoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ ImageOutput::write_image(TypeDesc format, const void* data, stride_t xstride,
&& progress_callback(
progress_callback_data,
(float)(z * m_spec.height
+ (isDecreasingY ? (m_spec.height - y) : y))
+ (isDecreasingY ? (m_spec.height - 1 - y) : y))
/ (m_spec.height * m_spec.depth)))
return ok;
}
Expand Down

0 comments on commit 40a14bb

Please sign in to comment.