mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
parent
578293cd16
commit
2bc741d197
1 changed files with 4 additions and 0 deletions
|
@ -90,6 +90,10 @@ fn get_image_from_pixmap(item: &TrayMenu, size: u32) -> Result<Image> {
|
|||
.and_then(|pixmap| pixmap.first())
|
||||
.ok_or_else(|| Report::msg("Failed to get pixmap from tray icon"))?;
|
||||
|
||||
if pixmap.width == 0 || pixmap.height == 0 {
|
||||
return Err(Report::msg("empty pixmap"));
|
||||
}
|
||||
|
||||
let mut pixels = pixmap.pixels.to_vec();
|
||||
|
||||
for i in (0..pixels.len()).step_by(4) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue