Author Topic: Exif information script  (Read 15994 times)

jgsack

  • Lives here ;-)
  • ***
  • Posts: 192
    • View Profile
Exif information script
« on: August 22, 2008, 09:17:07 pm »
(EDIT by Rolf: This is branched out from the Split Toning thread.)

I have found a perl package that seems to read exif data (including from xcf).
   Use: exiftool filename.xcf
 (I did run into a python prog of the same name  but the one I found doesn't seem to work at all.)

deb: libimage-exiftool-perl .. use apt-get install
rpm: perl-Image-ExifTool .. use yum install

--jim
« Last Edit: August 23, 2008, 02:25:31 pm by Rolf »

WarEagle

  • Regular
  • **
  • Posts: 41
    • View Profile
Exif information script
« Reply #1 on: August 22, 2008, 09:27:47 pm »
Hi Ger,

are you using linux? then you can install the exiftools and use the script attached.
It's just a dirty hacked version, but take it as a first version for the discussion. If you need more values, you can change the lines 40-47, if you need more features, just write them :)

@jgsack: this script is using the exiftools you posted
« Last Edit: August 22, 2008, 09:30:51 pm by WarEagle »

Rolf

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1887
    • View Profile
Exif information script
« Reply #2 on: August 22, 2008, 09:57:37 pm »
I just went into the kitchen, made and eat dinner, heard "Happy Shooting" and had some wine.

As I  came back there was a new script. Whow!

kulsecko

  • Regular
  • **
  • Posts: 7
    • View Profile
Exif information script
« Reply #3 on: August 23, 2008, 08:58:37 am »
Great, it will be good to make new thread for the EXIF script, someone who is not interested in split toning will not find it. But i think, that everyone is interested in EXIF  ;D

Rolf

  • Administrator
  • Sr. Member
  • ***
  • Posts: 1887
    • View Profile
Re: Exif information script
« Reply #4 on: August 23, 2008, 04:15:50 pm »
Done that... 

Ger

  • Guest
Re: Exif information script
« Reply #5 on: August 26, 2008, 06:37:50 pm »
@WarEagle; I did use Windows and Ubuntu on a dual boot machine.

@ Rolf; thank you for making this a new entry.

My old machine is RIP and I got a new one with Vista. Ubuntu will follow.
For now I got a problem which I certainly will solve. Python doesn't work with Gimp 2.4.7.
I will certainly try the script. It takes some time :-\


Ger

  • Guest
Re: Exif information script
« Reply #6 on: August 27, 2008, 05:29:30 pm »
Python works. I tried the script.
What a pity. I tried but each time it stops with an error.
It couldn't find the ISO information.  >:(
Who has an idea.

WarEagle

  • Regular
  • **
  • Posts: 41
    • View Profile
Re: Exif information script
« Reply #7 on: August 27, 2008, 05:49:17 pm »
You could try to run the command for getting the ISO-information (line 40)
    text=text + "ISO: " + commands.getoutput(exiftool + ' -s -s -s -ISO ' + filename)
so the command would be:
    exiftool -s -s -s -ISO <filename>
also please check if (in line 32) the path for exiftool is correct:
    exiftool="/usr/bin/exiftool"; # Please edit this

If the path is correct but it cannot find any metainformation then please run "exiftool <filename>" you then get all information exiftool can get from your image.

jgsack

  • Lives here ;-)
  • ***
  • Posts: 192
    • View Profile
Re: Exif information script
« Reply #8 on: August 27, 2008, 06:04:07 pm »
@Ger

I had the same problem with the LensID information. My camera includes no such data in it's exif information. Yours probably omits the ISO (maybe?). You can test it by running
    exiftool PIC0001.jpg
 (using your image filename, of course), and looking at what fields are provided.

I think the script could use some exception handling improvement when the asked-for data is missing.

At the risk of putting words into somebody else's mouth, it probably is true that the script is more of a proof of concept, and was envisioned as needing to be customized for your own caption preferences.

Even if you are not a programmer,  you might play with the script, by (eg) commenting out  (insert a '#') the line looking for ISO.

..jim

Ger

  • Guest
Re: Exif information script
« Reply #9 on: August 27, 2008, 06:38:02 pm »
WarEagle & JGSack, thanks for the post.
Untill now it didn't work. Later I will retry. Note that its not so important
If it doesn't work let it be.

I tried when Gimp was started and a photo loaded. Got again an error.

Traceback (most recent call last):
  File "C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins\ExifInfo.py", line 20, in <module>
    from gimpfu import *
ImportError: No module named gimpfu



WarEagle

  • Regular
  • **
  • Posts: 41
    • View Profile
Re: Exif information script
« Reply #10 on: August 27, 2008, 06:46:14 pm »
Oh you are using windows, I don't know if it works, because I guess the exiftool won't work, but give it a try.
You HAVE to change the path of the exiftool.

Because of your posted error.
Try to put a comment (#) infront of
from gimpfu import *
I don't really know if it is needed.

lhgray

  • Regular
  • **
  • Posts: 7
    • View Profile
Re: Exif information script
« Reply #11 on: August 27, 2008, 11:12:38 pm »
I'm no python expert, but I'm also trying to get the script to work under windows
As provided, it will not work under windows. The "commands" module that is imported at the beginning is only available for Unix systems. It needs to be replaced by the "subprocess" module. I'm trying to figure out the applicable command syntax.

The line defining the exiftool, I changed to:

exiftool=r"C:\Program Files\GeoSetter\tools\exiftool.exe"; # Please edit this

Note the 'r' in front of the first quote. This defines the string as raw and ensures that \t is not interpreted as a tab. Obviously, I used the exiftools that was installed with GeoSetter.

When I have a solution I will post it here.

Cheers


allix

  • Regular
  • **
  • Posts: 6
    • View Profile
Re: Exif information script
« Reply #12 on: August 29, 2008, 10:35:32 pm »
Hi, I have found a little bug in the script, if you apply the script to a image that is in a folder with spaces, it won't won't work and prints

ISO: File not found: /home/allix/Desktop/bit
File not found: n
File not found: pieces/nameofile.jpg, Aperture:  File not found:  /home/allix/Desktop/bit
File not found: n

When I move the image to a directory that does not have spaces like /home/allix/Desktop , it works fine...

Its a very nice scripts, thanks for taking the time to make it .



WarEagle

  • Regular
  • **
  • Posts: 41
    • View Profile
Re: Exif information script
« Reply #13 on: September 03, 2008, 05:58:58 pm »
Hi Allix,

please take look at this version, it should work with spaces in the filename.
If not please let me know...

allix

  • Regular
  • **
  • Posts: 6
    • View Profile
Re: Exif information script
« Reply #14 on: September 04, 2008, 10:14:07 am »
Thank you that works with directories with spaces ...