Compare commits

..

No commits in common. "a1ce17d675bc3970879c4f308d64efe728005538" and "f965b99e1d13af339e6b7a00a49f0364416d3055" have entirely different histories.

3 changed files with 3 additions and 9 deletions

View file

@ -36,6 +36,7 @@ class LightmeterAnalyticsFirebase implements ILightmeterAnalyticsApi {
stackTrace, stackTrace,
reason: reason, reason: reason,
information: information, information: information,
fatal: true,
); );
} }

View file

@ -10,14 +10,7 @@ Future<double> evFromImage(Uint8List bytes) async {
final apertureValueRatio = (tags["EXIF FNumber"]?.values as IfdRatios?)?.ratios.first; final apertureValueRatio = (tags["EXIF FNumber"]?.values as IfdRatios?)?.ratios.first;
final speedValueRatio = (tags["EXIF ExposureTime"]?.values as IfdRatios?)?.ratios.first; final speedValueRatio = (tags["EXIF ExposureTime"]?.values as IfdRatios?)?.ratios.first;
if (iso == null || apertureValueRatio == null || speedValueRatio == null) { if (iso == null || apertureValueRatio == null || speedValueRatio == null) {
throw ArgumentError( throw FlutterError('Error parsing EXIF: ${tags.keys}');
'Error parsing EXIF: ${tags.keys.join(', ')}',
[
if (iso == null) 'EXIF ISOSpeedRatings',
if (apertureValueRatio == null) 'EXIF FNumber',
if (speedValueRatio == null) 'EXIF ExposureTime',
].join(', '),
);
} }
final aperture = apertureValueRatio.numerator / apertureValueRatio.denominator; final aperture = apertureValueRatio.numerator / apertureValueRatio.denominator;

View file

@ -17,7 +17,7 @@ void main() {
'no EXIF', 'no EXIF',
() { () {
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync(); final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
expectLater(evFromImage(bytes), throwsArgumentError); expectLater(evFromImage(bytes), throwsFlutterError);
}, },
); );
}); });