Re: Decoding the image-data from a notification
chandler <[email protected]> Wed, 18 Oct 2023 07:40:30 -0700
| Newsgroups | gmane.comp.freedesktop.dbus |
|---|---|
| Message-ID | <[email protected]> |
Thomas Kluyver wrote on 9/28/23 12:24 AM: > Hi Chandler, > > On Thu, 28 Sep 2023, at 07:32, chandler wrote: >> I've had `dbus-monitor "interface='org.freedesktop.Notifications'"` >> running as a service, so the data from notifications is saved in the >> journal. How could I turn the `image-data` array of bytes back into an >> image? > The notifications spec has details of the data format for images being sent: > https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#icons-and-images > > It should be possible to reconstruct an image from that, using something like the Pillow library in Python, and then save it to any format you choose. > > Best wishes, > Thomas Thanks Thomas. Unfortunately I'm not skilled enough to come up with something from that, also my time is unfortunately limited, and this further relates to a legal matter. I searched and searched but no luck in figuring this out yet. Prior to posting here, I did find the below code^1 <#1> on Github, but still couldn't get that working even for new incoming notifications. It looks pretty complicated and I don't see any mention of Pillow, so maybe some updated code could work better. I have the output from dbus-monitor "interface='org.freedesktop.Notifications'" saved in the journal and right now there is one particular entry that I need to get decoded. I wonder if we could get the code below or something else working? Thanks, Chandler 1) Issue description How do I get the icon_data through a script. For example, Discord sends the profile picture in byte format and Spotify sends the album art in byte format. I am making a notificati... github.com Get icon_data. · Issue #1090 · dunst-project/dunst <https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667> Issue description How do I get the icon_data through a script. For example, Discord sends the profile picture in byte format and Spotify sends the album art in byte format. I am making a notification manager so I was wondering if getting... 🔗 https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667 <https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667>