Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIP2 #14

Merged
merged 11 commits into from
May 3, 2021
Merged

BIP2 #14

merged 11 commits into from
May 3, 2021

Conversation

bonjorno7
Copy link
Owner

I'd like a second opinion, because I'm not sure whether this is ready.

This format can store an arbitrary number of resolutions of the image in one file.
At the moment we're just doing two though, the first one for icons (32x32), the second for images (full size).
I'm not 100% satisfied with this code, but it does work.
Well actually I converted them from the original JPG / PNG files, but the result is the same.
I think this is a bit more elegant.
Removed some newlines which I felt didn't belong.
Renamed count to length when talking about (width * height), because that's what I call it elsewhere in the code too, and count refers to the amount of images in a BIP file.
Updated an assert message that I forgot to update earlier.
Changed how the data dictionary is used, so now icon_size and icon_pixels are set on its creation, and only overwritten in if the icon needed resizing.
I did the same for the loader and I like to be consistent.
@bonjorno7 bonjorno7 requested a review from coreprocess May 2, 2021 16:54
Functionally the same but more explicit.
Just to show that previews can be used as icons now.
@bonjorno7 bonjorno7 marked this pull request as ready for review May 3, 2021 14:22
bip/t3dn_bip/utils.py Show resolved Hide resolved
bip/t3dn_bip/utils.py Show resolved Hide resolved
bip/t3dn_bip/utils.py Show resolved Hide resolved
bip_converter/t3dn_bip_converter/convert.py Show resolved Hide resolved
bip_converter/t3dn_bip_converter/convert.py Show resolved Hide resolved
This code is a bit opaque otherwise.
Interestingly, the loader seems to support BIP2 files with only one resolution, even though it expects two.
I haven't tested it, but just reading the code, that's how it probably works.
@coreprocess coreprocess merged commit 4e1e2fe into develop May 3, 2021
@coreprocess coreprocess deleted the BIP2 branch May 3, 2021 20:46
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