-
Notifications
You must be signed in to change notification settings - Fork 167
Crash on ios if value of kCGImagePropertyGPSTimeStamp in exif is of type string #188
Comments
Thanks for reporting this issue @mevinDhun. The exif spec later on expects the GPS timestamp to be stored as a rationale - i.e a long value - this is the reason why we expect it to be a Can I ask where is this dictionary vended from? I guess we could very well make the conversion slightly less strict and thus allow string to rational conversions. Is this a change you'd be willing to submit? It'd require adding a |
Thanks for the quick response. We have an app where users can pick photos from their roll or via native in app camera capture. So we have seen that many of the photos are causing this crash, they could have originated from third party apps. Here's an example of a plugin which sets the timestamp as string: While i admit this is a wrong exif, i believe spectrum should not throw an exception in such cases. I currently use the work around to prevent this but i prefer not to handle any exif since spectrum already manages that.
Since it crashes in the
|
Hum - this may be a bug. Both Right, I was under the impression the timestamp was stored as a number in a Quick question - have you tried looking though the exif dictionary returned by the platform encoder to see how this entry is formatted? I think that would help us understand what's the best way forward. Thanks! |
Do you mean what does the exif look like when pictures are taken on stock ios camera app? |
Yes that's correct |
And if it is an I think mapping however the platform encoder behaves natively would make sense - thoughts? |
I just took an picture from ios stock camera and extracted the exif via exiftool on my mac:
So it turns out even Apple use string timestamps. When i select this image from ios image picker in my app, i get this as GPS metadata:
|
@cuva any updates on this? |
The following code causes spectrum to crash if the gps timestamp property is in string format instead of double. Here is the an extract of GPS dictionary from an image exif:
If i force the timestamp to a number, it works:
the crash happens on this line:
FSPCReportMustFix(@"Unexpected value: %@", value);
from the function
FSPInternalRationalsFromValues
in FSPImagemetadata.mmThe text was updated successfully, but these errors were encountered: