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());
|
||||
match buffer.write_all(&output_data) {
|
||||
Ok(_) => (),
|
||||
Err(_) => return Err(format!("Unable to write to stdout")),
|
||||
Err(_) => return Err("Unable to write to stdout".to_owned()),
|
||||
}
|
||||
} else {
|
||||
let out_file = match File::create(&opts.out_file) {
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ struct ScanLines<'a> {
|
|||
}
|
||||
|
||||
impl<'a> ScanLines<'a> {
|
||||
fn len(&mut self) -> usize {
|
||||
fn len(&self) -> usize {
|
||||
self.png.raw_data.len()
|
||||
}
|
||||
}
|
||||
|
|
@ -759,6 +759,7 @@ fn reduce_rgba_to_rgb(png: &PngData) -> Option<Vec<u8>> {
|
|||
if *byte != 255 {
|
||||
return None;
|
||||
}
|
||||
} else {
|
||||
reduced.push(*byte);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue