mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
Compare commits
No commits in common. "3a09b32356f7c2df6ee0eda8aaf28faed7684649" and "1b03199dde94d8c1e68d44813cab17540344cff1" have entirely different histories.
3a09b32356
...
1b03199dde
2 changed files with 2 additions and 9 deletions
|
@ -10,14 +10,7 @@ Future<double> evFromImage(Uint8List bytes) async {
|
|||
final apertureValueRatio = (tags["EXIF FNumber"]?.values as IfdRatios?)?.ratios.first;
|
||||
final speedValueRatio = (tags["EXIF ExposureTime"]?.values as IfdRatios?)?.ratios.first;
|
||||
if (iso == null || apertureValueRatio == null || speedValueRatio == null) {
|
||||
throw ArgumentError(
|
||||
'Error parsing EXIF: ${tags.keys.join(', ')}',
|
||||
[
|
||||
if (iso == null) 'EXIF ISOSpeedRatings',
|
||||
if (apertureValueRatio == null) 'EXIF FNumber',
|
||||
if (speedValueRatio == null) 'EXIF ExposureTime',
|
||||
].join(', '),
|
||||
);
|
||||
throw FlutterError('Error parsing EXIF: ${tags.keys}');
|
||||
}
|
||||
|
||||
final aperture = apertureValueRatio.numerator / apertureValueRatio.denominator;
|
||||
|
|
|
@ -17,7 +17,7 @@ void main() {
|
|||
'no EXIF',
|
||||
() {
|
||||
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
|
||||
expectLater(evFromImage(bytes), throwsArgumentError);
|
||||
expectLater(evFromImage(bytes), throwsFlutterError);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue