Right Click Exif Viewer for Photography - How-To

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

Right Click Exif Viewer for Photography - How-To

Postby yankee495 » Oct 3rd, '14, 07:17

After getting these the way I wanted them I uploaded a zip file to Google Drive. Read the post to find where to put them and how they work so you can change them or install what is needed (Exiftool and Kwrite).

https://drive.google.com/file/d/0BwNARPX5iDXZSjEtR0ROYmMzSGc/view?usp=sharing

Hello everyone,

I try to drop in and help out when I can or share things I've figured out, fixed or found. I recently bought a Nikon DSLR and wanted a simple Exif viewer and I mean simple. I ended up with three of them which took a while, but only because I couldn't figure out the formatting I wanted.

First you need to install Exiftool from the repositories. You can read all about it here: http://www.sno.phy.queensu.ca/~phil/exiftool/

One thing I wanted was to be able to right click an image, select View Exif and have a popup with it right there, simple. The problem was Exiftool gives you so much Exif information that you can't find and copy what you want easily. I've never seen anything give you that much info!

There are a couple of Facebook discussion groups and other forums, where people discuss and help each other learn about different cameras and settings etc. They want you to post basic info like below. All of that info is taken from the image file, jpg or Nikon's raw nef file in my case, camera model and lens info is included so you don't even have to remember which lens you were using, or dig through the long list provided by Exiftool. So here it is.

It has a top level menu item and three sub-menu items.

View Exif Info (This is the top level menu you will see when you right click on an image).
Sub-menu items (not numbered in the actual menu):
1. Web Exif Info
2. Long Exif Info
3. Short Exif Info

Web Exif Info is formatted for copy/paste to a web page to display only minimal info (FB, Forums etc). The camera and lens names are automatically read from the image so it always lists the right camera/lens. Web Exif Info is shown in the screenshot of the dialog box. I had not added the Focal Length yet so 116.0 mm isn't shown in the screenshot like below.

Screenshot: https://drive.google.com/file/d/0BwNARPX5iDXZR05ReGFyN20xNlk/view?usp=sharing

The output of option 1 Web Exif Info looks like this:

NIKON D5200, Tamron SP 70-300mm f/4-5.6 Di VC USD (A005)
Settings Used: (f/11.0, 1/500s, ISO 200, 116.0 mm)

The Long info is really long and I'm not going to paste it all here. It'll amaze you what it contains. The short one is more than most people need and isn't very short . I used exiftool and built these special service menus for Dolphin, they work in Konqueror also. It can do miracles but you have to figure out how and I stopped here. Just getting it to format the Web Info into two lines ready to paste took a while because I had a mistake I overlooked 50 times! With some study you can customize it how ever you like.

If you are not familiar with Service Menus they're fairly powerful and fairly easy to make. I actually found one that showed me how to use a text file to pass info to KDialog, but I totally redone it to be the way I wanted it using Exiftool. I couldn't figure out how to redirect the output of Exiftool directly to KDialog so I used the text file method. First make a text file called "web-post-exif.desktop" and put this in it:

Code: Select all
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/*;
Actions=;ExifInformation;
X-KDE-Priority=TopLevel
X-KDE-Submenu=View Exif Info

[Desktop Action ExifInformation]
Name=Web EXIF Info
Icon=folder-image
Exec=exiftool -f -p '$Model, $LensID \nSettings Used: (f/$Aperture, ${ShutterSpeed}s, ISO $EXIF:ISO, $FocalLength)' "%f" > /tmp/exif-info.txt && kdialog --textbox /tmp/exif-info.txt 640 480 && rm -f /tmp/exif-info.txt


Now copy that file to /home/YourName/.kde4/share/kde4/services/ServiceMenus

If the ServiceMenus directory doesn't exist then create it. Pay attention to capitalization on "Menus" in ServiceMenus or it will not work.

To make it available to all users copy it to /usr/share/kde4/services/ServiceMenus instead. That's it, you have the simple Web Exif Info menu item. When you right click an image you will see View Exif Info with a sub-menu Web Exif Info. You will probably have to close and reopen Dolphin to get it to show up, or try a couple of different images, but it'll appear. This made it a bit time consuming to get it formatted right because I couldn't tell if a change was in effect or just not working like I wanted. I'm not a programmer, just a decent hack if it isn't too difficult.

To make the sub-menu item Long Exif Info, make a text file called long-exif.desktop and put this in it and copy it to the same place:

Code: Select all
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/*;
Actions=;ExifInformation;
X-KDE-Priority=TopLevel
X-KDE-Submenu=View Exif Info

[Desktop Action ExifInformation]
Name=Long Exif Info
Icon=folder-image
Exec=exiftool -a -u -g1 -t "%f" > /tmp/exif-info.txt && kdialog --textbox /tmp/exif-info.txt 640 480 && rm -f /tmp/exif-info.txt


To make the sub-menu item Short Exif Info, make a text file called short-exif.desktop and put this in it and copy it to the same place. You might want to call it "Tree View" because I just remembered I changed it to -v (verbose) which gives you a tree like view of the Exif info. Of course you can experiment and change them or just use which ever one you like. I'm still fine tuning mine.

Code: Select all
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/*;
Actions=;ExifInformation;
X-KDE-Priority=TopLevel
X-KDE-Submenu=View Exif Info

[Desktop Action ExifInformation]
Name=Short EXIF Info
Icon=folder-image
Exec=exiftool -v -t "%f" > /tmp/exif-info.txt && kdialog --textbox /tmp/exif-info.txt 640 480 && rm -f /tmp/exif-info.txt


It's quick, simple and gives me instant info ready to paste without having to remember or type anything. I had a hard time getting all of the info to display right and still don't understand all of Exiftool's options, there are so many. Even the author points out on a page that if you're doing this, that and the other, a simple command line option can do it. I forget what it was but he had seen someone doing something the real hard way I guess.

It would be really nice to just redirect the output from Exiftool directly to KDialog, but like I said I don't know how. If anyone does, please post it or any .desktop files you make that you think others may find useful. There are tons of things you can do with Service Menus from re-sizing an image (not with Exiftool), renaming according to Exif tags or extracting the preview in the file. With a little reading there just about isn't any limits and I've just started customizing Mageia a little to help me with my Photos. Good Luck and have fun!

Here is an example of how handy this is! And yes, I'm loving this camera!

NIKON D5200, AF-S DX VR Zoom-Nikkor 18-55mm f/3.5-5.6G
Settings Used: (f/9.0, 1/160s, ISO 320, 36.0 mm)
https://drive.google.com/file/d/0BwNARPX5iDXZOGZRY19XU202N3c/view?usp=sharing
Last edited by yankee495 on Oct 28th, '14, 03:46, edited 1 time in total.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: Right Click Exif Viewer for Photography - How-To

Postby doktor5000 » Oct 3rd, '14, 10:44

Thanks for sharing :)
But next please post such how-to threads directly in the tips&tricks subforum ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Right Click Exif Viewer for Photography - How-To

Postby yankee495 » Oct 3rd, '14, 17:47

doktor5000 wrote:Thanks for sharing :)
But next please post such how-to threads directly in the tips&tricks subforum ;)


You're welcome and yes doktor, I looked for it, over looked it. Just tired I guess, I've posted there before. Thanks for moving it, sorry for the extra work.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: Right Click Exif Viewer for Photography - How-To

Postby doktor5000 » Oct 3rd, '14, 19:07

yankee495 wrote:If you are not familiar with Service Menus they're fairly powerful and fairly easy to make. I actually found one that showed me how to use a text file to pass info to KDialog, but I totally redone it to be the way I wanted it using Exiftool. I couldn't figure out how to redirect the output of Exiftool directly to KDialog so I used the text file method.


Actually passing text directly to kdialog is pretty easy, it also accepts input via stdin, maybe you can reuse that
Check e.g. http://shell-scripting.livejournal.com/13899.html or the answers in https://bugs.kde.org/show_bug.cgi?id=111388
Although that doesn't seem to work here on mga4, maybe kdialog lost that ability during the porting to KDE4

Otherwise just use zenity for that, it even supports formatting.

Manual: https://help.gnome.org/users/zenity/stable/
Formattin text in zenity:
http://askubuntu.com/questions/93918/ze ... -formating
http://www.pygtk.org/pygtk2reference/pa ... guage.html
http://stackoverflow.com/questions/2273 ... -list-text
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Right Click Exif Viewer for Photography - How-To

Postby yankee495 » Oct 3rd, '14, 19:42

Thanks Dok,

I tried the Linux Journal one using /dev/stdin and it's broken I guess. I have my /tmp as a RAM disk for my SSD so it flies anyway and I just left it as it was. I looked into Zenity but it installs lots of other stuff so again, I left it as it was. If I write a script and call it then I could do lots more and send it to KDialog last. That is what I'm looking into, using just Exiftool and a script that outputs to KDialog. If I understand it right KDialog can use a variable as input, but I couldn't get the Exec line in the .desktop file to assign the output of Exiftool to a variable and pipe it to KDialog. I haven't given up, just been busy.

It would probably be pretty easy to use C or something and not use KDialog at all. I was wanting to keep it simple and light weight. I couldn't believe there was nothing similar. Dolphin can display Exif data in the information panel but the Exposure is displayed wrong (broken) and you can't copy and paste it easily.

I couldn't find anything more simple than making a .desktop file and just using it. There are programs that allow you to browse and display Exif data but they are full programs and don't allow easy copy/paste of the info I wanted either. Now I can right click, copy/paste, then drag/drop to post all from Dolphin, which I am browsing with anyway, fast and simple. Thanks again, if I make any major improvements I'll post them, but don't expect miracles, simple was the goal.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: Right Click Exif Viewer for Photography - How-To

Postby yankee495 » Oct 5th, '14, 20:46

Hello,

I have decided I needed an option to open the Exif data in a text editor. This allows searching the data and or editing/saving it. It uses Kwrite and all you have to do is replace Kwrite in the .desktop file with kate or whatever you prefer to use. Follow the instructions in the first post to install it.

Code: Select all
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/*;
Actions=;ExifInformation;
X-KDE-Priority=TopLevel
X-KDE-Submenu=View Exif Info

[Desktop Action ExifInformation]
Name=View With Kwrite
Icon=folder-image
Exec=exiftool "%f" > /tmp/exif-info.txt | kwrite /tmp/exif-info.txt && rm -f /tmp/exif-info.txt
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA

Re: Right Click Exif Viewer for Photography - How-To

Postby doktor5000 » Oct 5th, '14, 21:08

yankee495 wrote:Exec=exiftool "%f" > /tmp/exif-info.txt | kwrite /tmp/exif-info.txt && rm -f /tmp/exif-info.txt


Could be simplified to
Code: Select all
Exec=exiftool "%f" | kwrite --stdin
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Right Click Exif Viewer for Photography - How-To

Postby yankee495 » Oct 5th, '14, 22:31

Thanks Dok, I did it the way I did with KDialog. I bet it works with stdin using Kwrite and others.
There are 10 types of people, those who understand binary & those who don't.
Main Desktop
http://www.overclock.net/lists/display/view/id/3960066
yankee495
 
Posts: 433
Joined: May 25th, '12, 13:10
Location: Carthage, Mo. USA


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron