mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
Compare commits
2 commits
1b03199dde
...
3a09b32356
Author | SHA1 | Date | |
---|---|---|---|
|
3a09b32356 | ||
|
a1ce17d675 |
2 changed files with 9 additions and 2 deletions
|
@ -10,7 +10,14 @@ 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 FlutterError('Error parsing EXIF: ${tags.keys}');
|
||||
throw ArgumentError(
|
||||
'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;
|
||||
|
|
|
@ -17,7 +17,7 @@ void main() {
|
|||
'no EXIF',
|
||||
() {
|
||||
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
|
||||
expectLater(evFromImage(bytes), throwsFlutterError);
|
||||
expectLater(evFromImage(bytes), throwsArgumentError);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue