22 Dec 2014, 00:00

Add “Strip Exif From JPG” Action to Dolphin’s Context Menu in Kubuntu/KDE

Below you can find instructions on how to add an action to the right-click context menu in Dolphin file manager for stripping one or multiple .JPG files from their Exif information.

First, find out where the new config file should be located:

$ kde4-config -path services
/home/user1/.kde/share/kde4/services/:/usr/share/kde4/services/

I chose to add it only for the current user:

$ vi /home/user1/.kde/share/kde4/services/strip_exif.desktop 
[Desktop Entry]
Type=Service
Name=convert
ServiceTypes=KonqPopupMenu/Plugin
Actions=Strip;
MimeType=image/jpeg;

[Desktop Action Strip]
Name=StripEXIF
Exec=convert -strip %f 'basename "%f" .JPG'_stripped.JPG
Icon=/usr/share/icons/Humanity/places/24/user-pictures.svg

It will not overwrite the picture, it will append _stripped to the filename. Just restart Dolphin for the changes to take effect.

Source and some reference.

Bonus: Here is a .desktop file for resizing one or multiples files to 1024×768:

$ vi /home/user1/.kde/share/kde4/services/resize_1024.desktop 
[Desktop Entry]
Type=Service
Name=convert
ServiceTypes=KonqPopupMenu/Plugin
Actions=Resize1024;
MimeType=image/jpeg;

[Desktop Action Resize1024]
Name=Resize1024
Exec=convert -resize 1024x768 %f 'basename "%f" .JPG'_1024x768.jpg
Icon=/usr/share/icons/Humanity/places/24/user-pictures.svg