Scenario - Image is captured and uploaded (the image could be used for multiple purpose) In one scenario this image uploaded consist of geotagging is to be identified

As per my understanding EXIF could be used to read the file which is being upload on load end event and geotag is fetched. Unable to fetch the geotag of image already stored. Any idea?

Attachment is saved with EncodingUtil.base64Decode

  • Is this supposed to be Apex or JavaScript? Or either? What's your preference? – sfdcfox Dec 21 '18 at 7:45
  • Any option will work, we need the geo location of already stored images – Needhi S Dec 24 '18 at 9:01

Accessing EXIF data could vary somewhat depending on the image file format. I discovered many open source programs available to read and edit EXIF data for a large variety of file formats. The issue you're going to have is that none of them I found will run on a Java based server. Many will run in a Windows environment and there are some that will run in Linux or on a Mac. I believe I may have seen one that could also be hosted on AWS, but I won't say for certain.

I remember seeing some that ran using either Perl or Python making Heroku a possibility to host this service for yourself. There are sites on the web that can also read this data for you as a service (could be heavy on your API usage). You'd need to make a call-out to send the files to them so they could read the data and return the results to you.

Here are a few search results that you may find helpful to you: Free Open Source Metadata editors Software - SourceForge, batch EXIF edit - SourceForge, and EXIFTool GitHub. Just examining the code might allow you to do some of this in Apex. Whether your use case for this will be enough to justify the effort is something you'll need to determine. If your organization can't justify it, you might want to consider creating an open source project for this on GitHub.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.