I need to take a picture with Android app (either from Camera or from Gallery) and check its EXIF date-time (and a couple other properties). I have successfully implemented recieving of the JPG image and loading it into TStream and GUI Image components. But I'm having trouble extracting the EXIF data.
I've tried the following code (and it's variants available on the internet):
procedure ReadEXIF(aPath: string);
var
LEXIF: JExifInterface;
LDateTaken: string;
begin
// Path looks like:
// /data/data/com.embarcadero.SimpleLogin/cache/IMG_20190305_085250104151537.jpg
LEXIF := TJExifInterface.JavaClass.init(StringToJString(aPath));
LDateTaken := JStringToString(LEXIF.getAttribute(TJExifInterface.JavaClass.TAG_DATETIME));
Log.d(LDateTaken);
end;
but it returns "Raw image not detected" error.
How do I read the EXIF data?
P.S. Tried the CCR-EXIF lib, but it won't compile for FMX (too many Ansi references throughout its code).
P.P.S. I've verified that received image has EXIF data (saved it from stream to other location and checked)