-3

I installed the package DEXIF and am able to read some EXIF-Entries. But not computed values as described in the documentation. The following code shows what works. For the commented lines I get the Error: identifier idents no member "focalLenght" and so on.. How can I get hold on these and more fields?

procedure TForm1.EXIFAnzeigen(filename: string);
var
  ImgData: TImgData;
  i :integer;
begin
  //EDitor leeren

  ValueListEditor1.Strings.Clear;
  if FileExists(filename) then begin
     ImgData:= TImgData.Create();
     ImgData.Tracelevel :=1;
     try
        if uppercase(ExtractFileExt(filename)) = '.JPG' then begin
           if ImgData.ProcessFile(filename) then begin
              if ImgData.HasEXIF then begin
                 ValueListEditor1.InsertRow('Camera Make',
                 ImgData.ExifObj.CameraMake,True);
                 ValueListEditor1.InsertRow('Camera Modell',
                 ImgData.ExifObj.CameraModel,True);
                 ValueListEditor1.InsertRow('Picture DateTime',
                 FormatDateTime(ISO_DATETIME_FORMAT, ImgData.ExifObj.GetImgDateTime),True);
                 ValueListEditor1.InsertRow('Width',
                 inttostr(ImgData.ExifObj.Width),True);
                 ValueListEditor1.InsertRow('FlashUsed',
                 intToStr(ImgData.ExifObj.FlashUsed),True);

//               ValueListEditor1.InsertRow('FocalLength',
//               inttostr(ImgData.ExifObj.FocalLength),True);
//               ValueListEditor1.InsertRow('ApertureFNumber',
//               ImgData.ExifObj.ApertureFNumber,True);
//               ValueListEditor1.InsertRow('ExposureTime',
//               ImgData.ExifObj.ExposureTime,True);
//               ValueListEditor1.InsertRow('Distance',
//               ImgData.ExifObj.Distance,True);
//               ValueListEditor1.InsertRow('Process',
//               ImgData.ExifObj.Process,True);
              end else begin
                  ValueListEditor1.InsertRow('No EXIF','No Data',True);
              end;
           end else begin
               ValueListEditor1.InsertRow('No EXIF','Processdata',True);
           end;
        end else begin
          ValueListEditor1.Strings.Clear;
        end;
    finally
      ImgData.Free;
    end;
  end;
end;
ratmalwer
  • 700
  • 5
  • 14
  • Did you try reading the source code to see what properties are available and when (and how) they can be used? – Ken White Nov 18 '17 at 00:00
  • I did seach the code but did no find 'FocalLenght' anywhere. Just read the documentation. – ratmalwer Nov 18 '17 at 00:03
  • Well, it's not `FocalLenght`, it's `FocalLength`, and if you're searching for it the way you've spelled it both in your post and the last comment, you clearly won't find it. If you spelled it correctly for your search and aren't finding it, it's not there. – Ken White Nov 18 '17 at 00:34
  • To all . thanks for downvoting instead helping!!! – ratmalwer Nov 18 '17 at 00:45
  • I've tried to help, so I'm not sure why you're yelling at me. You'll find that being rude here will not get you help; people don't like to help users who are not polite or that feel entitled. No one here **has** to help you; we do it for free because we're generous. No one **owes** you an answer. And it's been less than an hour since you posted your question. Be patient. If someone can help they will. If it's urgent, hire a contractor to help you immediately. If that's not suitable for you, there are other sites that are not SO where you can go ask for free help. – Ken White Nov 18 '17 at 00:48
  • I do not know who downvoted me (so I clearly adressed all). I spent some time helping others too but did not downvote anyone. Just trying to find someone who has experience with DEXIF who can point me to the right direction. Thanks anyway – ratmalwer Nov 18 '17 at 00:56
  • No, you didn't address all, because there is no sitewide broadcast here. If only one person has commented to your post, then any response goes directly to that one person. And complaining about a downvote doesn't work anyway; whoever downvoted did so and moved on, and most likely will never see the complaint. No one has to explain why they downvoted; voting here is anonymous, and anyone can use their votes for any post they like without providing an explanation. – Ken White Nov 18 '17 at 01:01
  • I'm wondering whether you read the documentation and source code at all. It looks like you made little effort and expected somebody else to do it for you. Which is precisely what happened. That's why I cast my downvote. – David Heffernan Nov 18 '17 at 07:49

1 Answers1

2

The documentation says:

Some of the more common fields are accessible as properties of the EXIFObj of the ImgData.

and shows an example reading those properties, partly same as you succeed to read with your code.

But the FocalLength, and the others that fail in your code, have to be accessed in another way as the document says:

Other EXIF field can be read by using the property TagValue and specifying the name of the EXIF property

The following example clarifies:

ValueListEditor1.InsertRow('FocalLength',
inttostr(ImgData.ExifObj.TagValue['FocalLength']),True);
Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54
  • Thanks .. that helped! I can access some more tags with this approach. But I have to go deeper as some tag-names are not found i expect to be present. Found this list on the net: http://www.exiv2.org/tags.html but i have to check if the names correspont to DEXIF and its results. – ratmalwer Nov 18 '17 at 15:22
  • Of course, better stick to the names in `dEXIF` or add possibly new names as needed. That is a totally different topic. Add a check before each item, something like `if ImgData.ExifObj.TagValue['FocalLength'] <> null then` to avoid errors – Tom Brunberg Nov 18 '17 at 16:18
  • Good Idea adding names to DEXIF if I capable... I will have a look at that now I understand it better. Have a nice weekend !!! – ratmalwer Nov 18 '17 at 17:52