mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
Compare commits
No commits in common. "a1ce17d675bc3970879c4f308d64efe728005538" and "f965b99e1d13af339e6b7a00a49f0364416d3055" have entirely different histories.
a1ce17d675
...
f965b99e1d
3 changed files with 3 additions and 9 deletions
|
@ -36,6 +36,7 @@ class LightmeterAnalyticsFirebase implements ILightmeterAnalyticsApi {
|
||||||
stackTrace,
|
stackTrace,
|
||||||
reason: reason,
|
reason: reason,
|
||||||
information: information,
|
information: information,
|
||||||
|
fatal: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue