Eine weitere Version von pic_convert.desktop, diese enthält weitere Spielereien, wie etwa aus Filmschnipseln animierte GIFs zu erstellen.
Dazu aber eine Warnung die ernst genommen sein will: die Filmschnipsel dürfen nur ganz winzig sein, die GIFs werden riesig, nehmen schnell riesige Megabytegröße an, sehr viel größer als der ursprüngliche Filmschnipsel, dafür aber in sehr guter Qualität.
Für diese Funktion muss FFmpeg installiert sein, falls das noch nicht der Fall ist:
sudo apt-get install ffmpeg
Außerdem ist noch Spielerei zum schicken von Bildchen in base64 Code in den KDE-Klipper enthalten. Keine Ahnung wofür man das unbedingt brauchen müsste, aber es ist möglich. Vielleicht können Webseiten-Maler etwas damit anfangen, dort sah ich schon häufiger base64, anstatt verlinkte Bildchen im Code.
Die Funktion für umwandeln in JPGs hat noch eine Extra-Feature bekommen, falls etwa mal ein PNG mit transparentem Hintergrund erwischt wird, wie beispielsweise, dieses von ClamAV hier:
Der im Orginal transparente Hintergrund wird dann in darkgrey umgewandelt. Man kann das im Code des pic_convert.desktop selbst ändern, beispielsweise durch white ersetzen. Es macht auch ein extra Pop-up zur Info wenn transparenter Hintergrund ersetzt wird.
Hier nun das neue $HOME/.local/share/kservices5/ServiceMenus/pic_convert.desktop:
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/bmp;image/jpeg;image/png;image/gif;image/webp;image/tiff;image/svg+xml;video/3gpp;video/3gpp2;video/mp4;video/mpeg;video/ogg;video/x-matroska;video/x-mjpeg;video/wmp;video/wmv;video/x-msvideo;video/x-flic;video/x-flv;video/x-sgi-movie;video/quicktime;image/vnd.microsoft.icon;
Actions=convert_to_jpg;convert_to_png;convert_to_webp;convert_to_bmp;convert_to_gif;convert_to_tiff;convert_to_svg;convert_to_ani_gif;convert_to_ico;convert_video_to_ani_gif;convert_to_data_image_png_base64_output_clipboard;convert_to_data_image_jpg_base64_output_clipboard;convert_to_data_image_gif_base64_output_clipboard;
X-KDE-Submenu=Picture convert to jpg, png, webp. bmp, tiff, svg ==>
X-KDE-Submenu[de]=Bild umwandeln zu jpg, png, webp. bmp, tiff, svg ==>
Icon=darktable
[Desktop Action convert_to_jpg]
Icon=darktable
Name=Convert to jpg
Name[de]=Umwandeln zu jpg
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/jpg/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/jpg/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/jpg/I`" ] && identify -format %%A "%f" | grep True && convert %f -background darkgrey -flatten "`echo "%f" | sed -e s/[^.]*$/jpg/I`" && notify-send -i dialog-ok-apply.png "Background transparency converted to darkgrey" || convert %f "`echo "%f" | sed -e s/[^.]*$/jpg/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to jpg: `echo "%f" | sed -e s/[^.]*$/jpg/I | xargs basename` Ready!"
[Desktop Action convert_to_png]
Icon=darktable
Name=Convert to png
Name[de]=Umwandeln zu png
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/png/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/png/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/png/I`" ] && convert %f "`echo "%f" | sed -e s/[^.]*$/png/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to png: `echo "%f" | sed -e s/[^.]*$/png/I | xargs basename` Ready!"
[Desktop Action convert_to_webp]
Icon=darktable
Name=Convert to webp
Name[de]=Umwandeln zu webp
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/webp/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/webm/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/webp/I`" ] && convert %f "`echo "%f" | sed -e s/[^.]*$/webp/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to png: `echo "%f" | sed -e s/[^.]*$/webp/I | xargs basename` Ready!"
[Desktop Action convert_to_bmp]
Icon=darktable
Name=Convert to bmp
Name[de]=Umwandeln zu bmp
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/bmp/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/bmp/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/bmp/I`" ] && convert %f "`echo "%f" | sed -e s/[^.]*$/bmp/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to bmp: `echo "%f" | sed -e s/[^.]*$/bmp/I | xargs basename` Ready!"
[Desktop Action convert_to_gif]
Icon=darktable
Name=Convert to gif
Name[de]=Umwandeln zu gif
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/gif/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/gif/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/gif/I`" ] && convert %f "`echo "%f" | sed -e s/[^.]*$/gif/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to gif: `echo "%f" | sed -e s/[^.]*$/gif/I | xargs basename` Ready!"
[Desktop Action convert_to_tiff]
Icon=darktable
Name=Convert to tiff
Name[de]=Umwandeln zu tiff
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/tiff/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/tiff/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/tiff/I`" ] && convert %f "`echo "%f" | sed -e s/[^.]*$/tiff/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to tiff: `echo "%f" | sed -e s/[^.]*$/tiff/I | xargs basename` Ready!"
[Desktop Action convert_to_svg]
Icon=darktable
Name=Convert to svg
Name[de]=Umwandeln zu svg
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/svg/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/svg/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/svg/I`" ] && inkscape --file=%f --export-plain-svg="`echo "%f" | sed -e s/[^.]*$/svg/I`" --without-gui && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to svg: `echo "%f" | sed -e s/[^.]*$/svg/I | xargs basename` Ready!"
[Desktop Action convert_to_ani_gif]
Icon=darktable
Name=Several pictures convert to animate gif
Name[de]=Mehrere Bilder umwandeln zu animiertem gif
Exec=[ -f "`echo "%f" | grep -E " "`" ] && notify-send -i window-close.png "STOP! `echo "Dont use blanks in Filenames!"`" ; [ -f "`ls -1 ani.gif`" ] && notify-send -i window-close.png "STOP! `echo "ani.gif"` File exists!" ; [ ! -f "`echo "%f" | grep -E " "`" ] && [ ! -f "`ls ani.gif`" ] && `echo "%f" | xargs basename >> ani_list.tmp` && convert -delay 100 -loop 0 `cat ani_list.tmp` ani.gif && rm ani_list.tmp && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to gif: `echo ani.gif` Ready!"
[Desktop Action convert_to_ico]
Icon=darktable
Name=Embed multiple sizes in ico
Name[de]=Mehrere Größen einbetten in ico
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/ico/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/ico/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/ico/I`" ] && convert %f -define icon:auto-resize=16,22,24,32,36,48,64,72,96,128,256 -compress zip "`echo "%f" | sed -e s/[^.]*$/ico/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Picture to ico: `echo "%f" | sed -e s/[^.]*$/ico/I | xargs basename` Ready!"
[Desktop Action convert_video_to_ani_gif]
Icon=darktable
Name=Video convert to animate gif
Name[de]=Video umwandeln zu animiertem gif
Exec=[ -f "`echo "%f" | sed -e s/[^.]*$/gif/I`" ] && notify-send -i window-close.png "STOP! `echo "%f" | sed -e s/[^.]*$/gif/I | xargs basename` File exists!" ; [ ! -f "`echo "%f" | sed -e s/[^.]*$/gif/I`" ] && ffmpeg -i "%f" -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "`echo "%f" | sed -e s/[^.]*$/gif/I`" && notify-send -i dialog-ok-apply.png "Ready! :-)" "Video to gif: `echo "%f" | sed -e s/[^.]*$/gif/I | xargs basename` Ready!"
[Desktop Action convert_to_data_image_png_base64_output_clipboard]
MimeType=image/png;
Icon=darktable
Name=Convert to data:image/png;base64, clipboard output
Name[de]=Umwandeln zu data:image/png;base64, Clipboard Ausgabe
Exec=echo "data:image/png;base64,`base64 -w 0 "%f"`" | xclip -r -selection clipboard && notify-send -i dialog-ok-apply.png "Ready! :-)" "Base64 in Clipboard: \n \n `echo "%f" | xargs basename`"
[Desktop Action convert_to_data_image_jpg_base64_output_clipboard]
MimeType=image/jpg;
Icon=darktable
Name=Convert to data:image/jpg;base64, clipboard output
Name[de]=Umwandeln zu data:image/jpg;base64, Clipboard Ausgabe
Exec=echo "data:image/jpg;base64,`base64 -w 0 "%f"`" | xclip -r -selection clipboard && notify-send -i dialog-ok-apply.jpg "Ready! :-)" "Base64 in Clipboard: \n \n `echo "%f" | xargs basename`"
[Desktop Action convert_to_data_image_gif_base64_output_clipboard]
MimeType=image/gif;
Icon=darktable
Name=Convert to data:image/gif;base64, clipboard output
Name[de]=Umwandeln zu data:image/gif;base64, Clipboard Ausgabe
Exec=echo "data:image/gif;base64,`base64 -w 0 "%f"`" | xclip -r -selection clipboard && notify-send -i dialog-ok-apply.gif "Ready! :-)" "Base64 in Clipboard: \n \n `echo "%f" | xargs basename`"