From 89ffb1b433fc434ae4605ced2096cabf7f80f489 Mon Sep 17 00:00:00 2001 From: nwin Date: Fri, 3 Apr 2015 14:13:00 +0200 Subject: [PATCH 1/2] fix warnings --- src/png/decoder.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/png/decoder.rs b/src/png/decoder.rs index ed42286cc5..6f9c16cf2d 100644 --- a/src/png/decoder.rs +++ b/src/png/decoder.rs @@ -1,5 +1,5 @@ use std::io::{ self, Read }; -use std::{ cmp, mem, iter, str, slice }; +use std::{ cmp, iter, str, slice }; use std::iter::repeat; use std::num::{ FromPrimitive, Float }; use byteorder::{ ReadBytesExt, BigEndian }; @@ -436,14 +436,12 @@ impl PNGDecoder { expand_trns_line_nbits( buf, trns[0], - rlength as usize, self.bit_depth ); } else { expand_trns_line( buf, trns, - rlength as usize, color::num_components(self.data_pixel_type) ); } @@ -595,7 +593,7 @@ where F: Fn(u8, &mut[u8]) { } } -fn expand_trns_line(buf: &mut[u8], trns: &[u8], entries: usize, channels: usize) { +fn expand_trns_line(buf: &mut[u8], trns: &[u8], channels: usize) { let channels = channels as isize; let i = (buf.len() as isize / (channels+1) * channels - channels..-(channels)).step_by(-channels); let j = (buf.len() as isize - (channels+1)..-(channels+1)).step_by(-(channels+1)); @@ -614,7 +612,7 @@ fn expand_trns_line(buf: &mut[u8], trns: &[u8], entries: usize, channels: usize) } } -fn expand_trns_line_nbits(buf: &mut[u8], trns: u8, entries: usize, bit_depth: u8) { +fn expand_trns_line_nbits(buf: &mut[u8], trns: u8, bit_depth: u8) { let scaling_factor = (255)/((1u16 << bit_depth) - 1) as u8; expand_packed(buf, 2, bit_depth, |pixel, chunk| { if pixel == trns { From 6282bb317a4246e36684aeec7285c44ceaa977c9 Mon Sep 17 00:00:00 2001 From: nwin Date: Fri, 3 Apr 2015 14:13:52 +0200 Subject: [PATCH 2/2] bump version --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index db552eb0d5..3bb2d717e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "image" -version = "0.3.4" +version = "0.3.5" license = "MIT" description = "Imaging library written in Rust. Provides basic filters and decoders for the most common image formats." authors = [ @@ -22,13 +22,13 @@ name = "image" path = "./src/lib.rs" [dependencies.byteorder] -version = "0.3.3" +version = "0.3.5" [dependencies.num] -version = "0.1.18" +version = "0.1.20" [dev-dependencies.glob] -version = "0.2.7" +version = "0.2.9" [features] default = ["gif", "jpeg", "png", "ppm", "tga", "tiff", "webp"]