! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
FEATURE REQUEST, NOT A BUG : custom command receives the captured data
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-screenshooter
Component:
General

Comments

Description skullnobrains 2012-03-30 18:25:23 CEST
hello

the feature would be the ability to pipe the captured image into a custom script or command

namely, i would like to be able to capture an image into the pastebin but transform it beforehand into an html-compatible inline image such as "data:image/png;base64,iVBO..." (so the pastebin would actually be filled with a text string)

Maybe this could be implemented as a directly available feature ?

I'm willing to perform tests as necessary but i do not have the time and scarcely the knowledge to submit a patch myself, and I'm not sure weather this feature interests other users.

best regards and thanks for the great work

a. bialot
Comment 1 Jérôme Guelfucci editbugs 2012-04-07 17:57:41 CEST
You can already achieve this by creating a .desktop file for your script and by putting it in .local/share/applications/. It should handle PNG images and contain %f in the Exec line.

For reference, see http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html.

In think it's simpler to keep it that way, it would clutter the interface to add an UI for this. This could be documented in the help though.
Comment 2 skullnobrains 2012-04-10 12:30:16 CEST
hello

i well understand your concerns and why you believe it would be better not to add the option in the screenshooter plugin itself

in case you wish to update the documentation, and although i still believe it would be pretty useful to have it out-of-the-box, the below quick-and-dirty script produces a command which can be associated with the screenshooter once you opened at least one png file with it manually, and providing xsel and base64 commands are available

<script>
alex@alexb:~$ cat /usr/local/bin/png_to_pastable_data_url.sh 
#!/bin/sh
echo "data://image/png;base64,"`base64 $1` | tr -d "\n" | xsel -i
</script>

i believe this method to be more portable and less intrusive than using .desktop files but that is probably a matter of appreciation.

thanks a lot for your time and please accept apologize for using the word "pastebin" instead of "clipboard".

best regards

skullnobrains

Bug #8610

Reported by:
skullnobrains
Reported on: 2012-03-30
Last modified on: 2012-04-10

People

Assignee:
Jérôme Guelfucci
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information