Fix most of rgba tests
This commit is contained in:
parent
30f03678d2
commit
d2cd105b1a
2 changed files with 3 additions and 2 deletions
|
|
@ -215,7 +215,7 @@ pub fn optimize(filepath: &Path, opts: &Options) -> Result<(), String> {
|
||||||
let mut buffer = BufWriter::new(io::stdout());
|
let mut buffer = BufWriter::new(io::stdout());
|
||||||
match buffer.write_all(&output_data) {
|
match buffer.write_all(&output_data) {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(_) => return Err(format!("Unable to write to stdout")),
|
Err(_) => return Err("Unable to write to stdout".to_owned()),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let out_file = match File::create(&opts.out_file) {
|
let out_file = match File::create(&opts.out_file) {
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ struct ScanLines<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ScanLines<'a> {
|
impl<'a> ScanLines<'a> {
|
||||||
fn len(&mut self) -> usize {
|
fn len(&self) -> usize {
|
||||||
self.png.raw_data.len()
|
self.png.raw_data.len()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -759,6 +759,7 @@ fn reduce_rgba_to_rgb(png: &PngData) -> Option<Vec<u8>> {
|
||||||
if *byte != 255 {
|
if *byte != 255 {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
reduced.push(*byte);
|
reduced.push(*byte);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue