Skip to content

Commit

Permalink
Fix SAR calculation for real
Browse files Browse the repository at this point in the history
  • Loading branch information
myrsloik committed Sep 27, 2023
1 parent 3c32717 commit 8c68f4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
r65:
fixed the sar adjustment for real this time

r64:
fixed compilation on osx where the default standard library doesn't have a full implementation of std::from_chars
fixed SAR adjustment in resizer when source cropping is used
Expand Down
2 changes: 1 addition & 1 deletion src/core/vsresize.cpp
Expand Up @@ -336,7 +336,7 @@ void propagate_sar(const VSMap *src_props, VSMap *dst_props, const zimg_image_fo
muldivRational(&sar_num, &sar_den, src_format.width, dst_format.width);

if (!std::isnan(src_format.active_region.height) && src_format.active_region.height != src_format.height)
muldivRational(&sar_num, &sar_den, std::llround(src_format.active_region.height * 16), static_cast<int64_t>(dst_format.height) * 16);
muldivRational(&sar_num, &sar_den, static_cast<int64_t>(dst_format.height) * 16, std::llround(src_format.active_region.height * 16));
else
muldivRational(&sar_num, &sar_den, dst_format.height, src_format.height);

Expand Down

0 comments on commit 8c68f4d

Please sign in to comment.