Skip to content

Conversation

@kpreid
Copy link
Contributor

@kpreid kpreid commented Sep 13, 2025

Make decode() produce Vec<[u8; 4]> instead of Vec<u8>. This has identical memory layout, but guarantees that the output will always be a multiple of 4 bytes long and allows the caller to easily manipulate whole pixels. If they want the original type, they can call Vec::into_flattened() to obtain it for free.

Also, add documentation to decode().

This has identical memory layout, but guarantees that the output will
always be a multiple of 4 bytes long and allows the caller to easily
manipulate whole pixels.
Copy link
Owner

@bschwind bschwind left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for the delay!

@bschwind bschwind merged commit fc80a0a into bschwind:main Sep 23, 2025
3 checks passed
@kpreid kpreid deleted the vec4 branch September 23, 2025 14:54
@kpreid
Copy link
Contributor Author

kpreid commented Sep 23, 2025

Thank you! Since we were previously discussing planning breaking changes, I’ll say that this was the last breaking change I had in mind and, for my own purposes, I’d be happy if you were to make a release now.

@bschwind
Copy link
Owner

@kpreid sounds good, I'll try to cut a new release soon.

@bschwind
Copy link
Owner

bschwind commented Oct 2, 2025

@kpreid sorry for the wait, version 0.2 is published now :)

https://crates.io/crates/png-decoder

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