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

Interface restrictions for gif and jpeg #1126

Merged
merged 2 commits into from Feb 2, 2020

Conversation

HeroicKatora
Copy link
Member

Hide some public interface dependencies on gif and jpeg. Note that frame
oriented functions are now unused and will likely be brought back in a
(slightly less generic) manner that is more uniform over other multi
frame formats as well.

Hide some public interface dependencies on gif and jpeg. Note that frame
oriented functions are now unused and will likely be brought back in a
(slightly less generic) manner that is more uniform over other multi
frame formats as well.
@HeroicKatora
Copy link
Member Author

I just realized that there's a bug hidden in the interface. Note how several interfaces such as the io in free_functions.rs calls gif::Frame::from_rgb directly and without checking the color type and lossy-casting the width and height with as u16.

"gif" => gif::Encoder::new(fout).encode(&gif::Frame::from_rgb(width as u16, height as u16, &buf)),

So, I'll rewrite the interface to align to png::PngEncoder::write_image and make this a bug-fix as well.

Note that some use within the library itself would use a buffer with
wrong buffer size or disregard width and height errors.
@HeroicKatora HeroicKatora merged commit 90a21f3 into image-rs:next Feb 2, 2020
@HeroicKatora HeroicKatora deleted the remove-public-dependencies branch February 2, 2020 17:30
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.

None yet

1 participant