Skip to content

Fix height/width computation#21

Merged
Falcury merged 1 commit intoamspath:mainfrom
NKI-AI:fix-image-size
Apr 28, 2023
Merged

Fix height/width computation#21
Falcury merged 1 commit intoamspath:mainfrom
NKI-AI:fix-image-size

Conversation

@jonasteuwen
Copy link
Copy Markdown
Collaborator

@jonasteuwen jonasteuwen commented Apr 24, 2023

This PR fixes the height/width computation. See #20. Also matches python implementation.

@jonasteuwen
Copy link
Copy Markdown
Collaborator Author

jonasteuwen commented Apr 24, 2023

This fixes level 0, but not the rest (openphi vs libisyntax):

  1. (202758, 95238) - (202758, 95238)
  2. (101377, 47617) - (101379, 47619) (+2)
  3. (50686, 23806) - (50689, 23809) (+3)
  4. (25341, 11901) - (25344, 11904) (+3)
  5. (12669, 5949) - (12672, 5952) (+3)
  6. (6333, 2973) - (6336, 2976) (+3)
  7. (3165, 1485) - (3168, 1488) (+3)
  8. (1581, 741) - (1584, 744) (+3)
  9. (789, 369) - (792, 372) (+3)

Note level_padding is 1533 in this case.
This is very weird though, you'd expect a / 2.

@Falcury
Copy link
Copy Markdown
Member

Falcury commented Apr 28, 2023

Can I merge this, or should we wait until it's fixed for all the levels beside level 0?

@jonasteuwen
Copy link
Copy Markdown
Collaborator Author

@Falcury I would fix it in level 0, the other levels are no proper power of 2, and I can’t figure out any formula that generates these values.

These 2-3 pixels are also not an issue because of the minimal padding, so I don’t think it will ever be out of bounds. So I would consider the current one ‘correct’

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