Skip to content

Block count calc fix#46

Open
beauknowssoftware wants to merge 7 commits into
Traverse-Research:mainfrom
beauknowssoftware:output-size-calc-fix
Open

Block count calc fix#46
beauknowssoftware wants to merge 7 commits into
Traverse-Research:mainfrom
beauknowssoftware:output-size-calc-fix

Conversation

@beauknowssoftware
Copy link
Copy Markdown

The previous block count calculation worked for most resolutions. However, some degenerate resolutions received the wrong block counts.

Take a 2x7 image for example. The previous calculation would give it a block count of 1, since 2*7=14, and 14/16 rounded up was 1.

However, this image should have 2 blocks. A 2x4 block, and a 2x3 block.

Copy link
Copy Markdown
Member

@Jasper-Bekkers Jasper-Bekkers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the correction @beauknowssoftware

It actually looks like this crate is using a helper still divide_up_by_multiple that made it into rust some time ago also: div_ceil we might want to address that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants