Recent

Author Topic: FPexif-package Retrieve all exif-info ?  (Read 2403 times)

WimVan

  • Jr. Member
  • **
  • Posts: 76
FPexif-package Retrieve all exif-info ?
« on: January 23, 2019, 08:51:42 am »
As photographer, I'm always interested in info which is kept in the exif-part of an image, film.
Normally I'm using a process and EXIFtool to retrieve this kind of information.
This procedure is huge because you have to run a command with several parameters.  Each time you run it, a popup-windows appears and closes ... and finally you have to treat the returned info.
This is very tricky and if you request the result in a json-format and try to insert this in a memo, you are not always sure you see the result completely.
A workarround is asking the info in fe php-form and filter the result ...
I note that there is a package foreseen FPexif to treat the exif.
Some questions:
Is it possible to retrieve all info from an exif ?  For as far I saw, Fpexif reads out some info, but not all. 
In the exif we have several section which are filled in by
1) the firm of the camera with his proper tagnames and info
2) Programs that treated the image fe Adobe ...

Part 1 and part 2 are for me very interestfull.  Part 2 is filled in by using fe adobe and there you get a history of what is done, which programm was used, the date it was used ...

Problem is in this case is that info is there, but the tag, fieldname is depended of the softwarehouse or camera-firm.

For as far I saw the package, you can retrieve info on condition you know the fieldname inserted in the class.
class=><fieldname>
The later however you not always know.
 

wp

  • Hero Member
  • *****
  • Posts: 6645
Re: FPexif-package Retrieve all exif-info ?
« Reply #1 on: January 23, 2019, 09:31:54 am »
FPExif iterates through all EXIF records found, but deciphers only those which it knows. Therefore, it may well be that there are some fields which it does not display.

1) the firm of the camera with his proper tagnames and info
Aren't these the Make and Model tags? There may be more specific information in the MakerNotes field, but this information is not documented and difficult to access. Some people reverse-engineered the notes for some camera models, and these results are included, but others are left undecoded.

2) Programs that treated the image fe Adobe ...
There is a standard tag "Software". I saved one of my own photos with Paintshop Pro, and this field was populated now. So, maybe this is what you need.

Try the attached demo.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

WimVan

  • Jr. Member
  • **
  • Posts: 76
Re: FPexif-package Retrieve all exif-info ?
« Reply #2 on: January 23, 2019, 10:06:49 am »
Thanks for the answer.
The maker-notes-section is the for me most interesting part.  There the camera-producer enters data (tags and content) taht are typical for his images ...
That's why Exiftools has so much updates (if you use fe geosetter).  A part the camera-tags, Nikon fe also inserts data about the used objective.  Sometimes they even add the serial of the camera and the serial of the used lens.
Sometimes we can retrieve how many click are made by the camera and can even differ between a jpeg and a nef.
I now dreaming ....
A trigger in the package that gets the last exiftool-version (stuff used by geosetter) and filter it so that new tags are added ?
I have for the moment over more than 900 different tag-names grouped by camera, lens. 
This info can also be found on the net.
Just an idea of mine...

wp

  • Hero Member
  • *****
  • Posts: 6645
Re: FPexif-package Retrieve all exif-info ?
« Reply #3 on: January 23, 2019, 10:25:17 am »
Can you post one of the Nikon photos on Dropbox/GoogleDrive etc and share the link? (You can send me a PM with the link if you don't want to publish the photo). fpexif does analyze the Nikon MakerNote tags which maybe can be extended when there is an image for testing.

An important note regarding MakerNote in fpexif: Be careful when you edit EXIF tags. Some MakerNote tags are written with offsets to data fields being relative to the begin of the EXIF structure. When you edit standard EXIF tags the size of their data fields may change, and all offsets to data in the EXIF structure will change. While this can be corrected for the standard tags it is very risky for MakerNote fields which are poorly documented and usually only partly decoded. You must expect loss of the MakerNote tag in the worst case.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

WimVan

  • Jr. Member
  • **
  • Posts: 76
Re: FPexif-package Retrieve all exif-info ?
« Reply #4 on: January 23, 2019, 12:05:46 pm »
Give me some days.  I'll ask to my group to deliver pictures from different Nikon (Jpeg and NEF) and Canon (Jpeg and RAW) and Fujifilm (Jpeg and RAF). from the latest camera's
And you are right, changing data in the Makernotes-section is dangerous, but I can not see wy we should modify data in tha section.  It is proper data coming from the camera and the used lenses...
Why should we change the number of clicks we made with the camera?  to cheat ourself  of some one else if we want to sell it?
Changing the creationdate (because our camera can have a not-synchronised date), gps-entry, author-entry.
And there is a small section that we can use without any problem if we respect the foreseen space

I once changed the Camera-name to an older one so I could open the image with Adobe Lightroom, fotoshop.  They uses the name to check it in a list to get availability to Photoshop and/or Lightroom.  After working on it, I rechanged the cameraname.

Any way nice stuff.

wp

  • Hero Member
  • *****
  • Posts: 6645
Re: FPexif-package Retrieve all exif-info ?
« Reply #5 on: January 23, 2019, 03:13:21 pm »
Of course, changing MakerNote data is risky. But it is worse: changing any data is risky if you are interested in MakerNotes.

EXIF consists of several arrays of records with an integer for tag ID, an integer for the tag size (bytes) and an integer for the tag data. The tag data, however, are written within the record only if the byte size is at most 4 - in all other cases the tag's data are written somewhere else, and the data field contains only the offset to the data. This offset refers to the beginning of the EXIF structure.

And this is the problem: Many manufacturers use the same structure within the MakerNote record - i.e. write offsets from the beginning of the EXIF structure, not relative to the beginning of the MakerNotes. This means than, when for example there is a Description record (which is a well-documented standard EXIF tag) before the MakerNotes and you edit the description the MakerNotes will shift by some bytes - but the tags within the MakerNotes still are seen relative to the beginning of the EXIF segment. To fix this a program must decode the entire MakerNotes and after editing it must rewrite all MakerNote tags with their new offsets. If this does not occur decoding of the MakerNotes of an edited file will find the wrong offset and the reader will probably crash. Therefore, many programs remove the MakerNotes from the EXIF segment.

I am sure, however, that Adobe knows all the internals of any MakerNotes. Therefore, I am not surprised that you could read the EXIF data of the modified image. Don't expect this to be true for an arbitrary other program.

Changing the creation date and gps coordinates, I think, is not critical because these data blocks have a fixed size and will not modify any data offsets. The author tag, however, is critical because of its variable length (at least for fpexif).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

WimVan

  • Jr. Member
  • **
  • Posts: 76
Re: FPexif-package Retrieve all exif-info ?
« Reply #6 on: January 23, 2019, 05:30:09 pm »
Thanks for the reply.
I normaly get all needed tag-info for Nikon from
https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html

It is the info delivered by Phil Harvey who own exiftool.

adn here you can find all known tags for several camera's firms

https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames

wp

  • Hero Member
  • *****
  • Posts: 6645
Re: FPexif-package Retrieve all exif-info ?
« Reply #7 on: January 23, 2019, 06:24:55 pm »
I know. But even this well-known site is lacking important details which I found e.g. in http://www.exiv2.org/makernote.html
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

vrull

  • Full Member
  • ***
  • Posts: 112
Re: FPexif-package Retrieve all exif-info ?
« Reply #8 on: November 24, 2019, 07:32:53 am »
My two cents, just for completeness sake.

The package fpexif is not installed in Lazarus by default, so it can be found there:
https://sourceforge.net/p/lazarus-ccr/svn/7194/tree/components/fpexif/

Attached is a modified version of the demo by WP, which displays all tags with their values found in the provided JPEG file.