When the TrFile_GetMetaData function returns a $$-302 error (smFormatErr) when getting EXIF metadata from an image file, the Exif metadata in the image is corrupt. The plug-in can not read this EXIF data.
Removing the corrupt EXIF data
To get rid of the error you can create a copy of the image without the corrupt EXIF, by removing all EXIF data. Use the TrFile_SetMetaData function, like this:
Set Variable [$EmptyMetaDataBlock ; ""]
Set Variable [$ErrorCode ; TrFile_SetMetaData( "-SetExif " ;
$PathToSourceFile; $PathToDestinationFile ; $EmptyMetaDataBlock) ]
See also the “Remove all Exif” tab in the SetExif.fmp12 example file that is included in the download of Troi File Plug-in.