Skip to content

Commit

Permalink
tg """maintainer""" moment
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeWaka committed Dec 20, 2023
1 parent 56cc35b commit 5468477
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{error, ztxt, RawDmi};
use image::codecs::png;
use image::imageops;
use image::GenericImageView;
use image::ImageEncoder;
use std::collections::HashMap;
use std::io::prelude::*;
use std::io::Cursor;
Expand Down Expand Up @@ -357,16 +356,13 @@ impl Icon {
}

let mut dmi_data = Cursor::new(vec![]);
// We're futzing around with pngs directly here so we can use the best possible compression
let bytes = new_png.as_bytes();
let (width, height) = new_png.dimensions();
let color = new_png.color();
// Use the 'Default' compression - the actual default for the library is 'Fast'
let encoder = png::PngEncoder::new_with_quality(
&mut dmi_data,
png::CompressionType::Default,
png::FilterType::Adaptive,
);
encoder.write_image(bytes, width, height, color)?;
new_png.write_with_encoder(encoder)?;
let mut new_dmi = RawDmi::load(&dmi_data.into_inner()[..])?;

let new_ztxt = ztxt::create_ztxt_chunk(signature.as_bytes())?;
Expand Down

0 comments on commit 5468477

Please sign in to comment.