|
@@ -516,6 +516,13 @@ fn png_icon<P: AsRef<Path>>(
|
|
|
let mut reader = decoder
|
|
|
.read_info()
|
|
|
.unwrap_or_else(|e| panic!("failed to read icon {}: {}", path.display(), e));
|
|
|
+
|
|
|
+ let (color_type, _) = reader.output_color_type();
|
|
|
+
|
|
|
+ if color_type != png::ColorType::Rgba {
|
|
|
+ panic!("icon {} is not RGBA", path.display());
|
|
|
+ }
|
|
|
+
|
|
|
let mut buffer: Vec<u8> = Vec::new();
|
|
|
while let Ok(Some(row)) = reader.next_row() {
|
|
|
buffer.extend(row.data());
|