<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Thomas Kluyver wrote on 9/28/23 12:24
AM:<br>
</div>
<blockquote type="cite"
cite="mid:79eb50c1-fded-4716-a820-92b94570b439@app.fastmail.com">
<pre class="moz-quote-pre" wrap="">Hi Chandler,
On Thu, 28 Sep 2023, at 07:32, chandler wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">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?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">The notifications spec has details of the data format for images being sent:
<a class="moz-txt-link-freetext" href="https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#icons-and-images">https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#icons-and-images</a>
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
</pre>
</blockquote>
<p> 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.</p>
<p> Prior to posting here, I did find <a href="#1">the below
code<sup>1</sup></a> 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 <tt>dbus-monitor
"interface='org.freedesktop.Notifications'"</tt> saved in the
journal and right now there is one particular entry that I need to
get decoded.</p>
<p> I wonder if we could get the code below or something else
working?</p>
<p>Thanks,<br>
Chandler</p>
<p>1)<a name="1"></a><br>
</p>
<aside xmlns="http://www.w3.org/1999/xhtml"
class="moz-card url-replaced"
style="width:600px; display:flex; align-items:center; justify-content:center; flex-direction:row; flex-wrap:wrap; border-radius:10px; border:1px solid silver;"
id="card-1697635936042">
<div class="card-pic"
style="display:flex; flex-direction:column; flex-basis:100%; flex:1;">
<div style="margin:0 5px;"> <img
src="https://opengraph.githubassets.com/46c7796c9a95a7ed529ef73e6e51a4c09fd9e325de5637b30601b6d76a72ce12/dunst-project/dunst/issues/1090"
style="width: 600px;"
alt="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...">
</div>
</div>
<div class="card-content"
style="display:flex; flex-direction:column; flex-basis:100%; flex:3;">
<div style="margin:0 1em;">
<p><small class="site" style="font-weight:lighter;">github.com</small></p>
<p> <a
href="https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667"
style="font-weight:600; text-decoration:none;"><big
class="title">Get icon_data. · Issue #1090 ·
dunst-project/dunst</big></a> </p>
<p class="description">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...</p>
<p> <a
href="https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667"
class="url"
style="display:inline-block; text-decoration:none; text-indent:-2ch; margin-inline:2ch;"
title="github.com">🔗
https://github.com/dunst-project/dunst/issues/1090#issuecomment-1192500667</a>
</p>
</div>
</div>
</aside>
<p> </p>
</body>
</html>