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

Remove the zlib "inflate" implementation from the image library #223

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ git = "https://github.com/rust-lang/num"

[dev-dependencies.glob]
git = "https://github.com/rust-lang/glob"

[dependencies.zlib]
git = "https://github.com/sivadeilra/zlib"
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

extern crate flate;
extern crate num;
extern crate zlib;

pub use color::ColorType as ColorType;
pub use traits::Primitive;
Expand Down
7 changes: 4 additions & 3 deletions src/png/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use color;

use super::filter::unfilter;
use super::hash::Crc32;
use super::zlib::ZlibDecoder;

use zlib::inflate::InflateReader;

use std::num::Float;

Expand Down Expand Up @@ -121,7 +122,7 @@ impl Iterator<(u8, u32, u32)> for Adam7Iterator {
///
/// Currently does not support decoding of interlaced images
pub struct PNGDecoder<R> {
z: ZlibDecoder<IDATReader<R>>,
z: InflateReader<IDATReader<R>>,
crc: Crc32,
previous: Vec<u8>,
state: PNGState,
Expand Down Expand Up @@ -157,7 +158,7 @@ impl<R: Reader> PNGDecoder<R> {

previous: Vec::new(),
state: PNGState::Start,
z: ZlibDecoder::new(idat_reader),
z: InflateReader::new_inflate(0x10000, idat_reader),
crc: Crc32::new(),

width: 0,
Expand Down
Loading