Compare commits

...

6 commits

Author SHA1 Message Date
Vadim
1b508ca894 added no EXIF test to evFromImage 2024-01-13 18:04:47 +01:00
Vadim
60323f4856 Merge branch 'feature/iap' of https://github.com/vodemn/m3_lightmeter into feature/iap 2024-01-13 17:55:26 +01:00
Vadim
cb6880da49 added evFromImage test 2024-01-13 17:55:02 +01:00
Vadim
d6fa69400a
Merge branch 'main' into feature/iap 2024-01-13 17:42:45 +01:00
nathan musoke
a2b4c88256
Fixed typo in reciprocity description (#142)
grater -> greater

Co-authored-by: Vadim <44135514+vodemn@users.noreply.github.com>
2024-01-13 17:42:23 +01:00
Vadim
d09542cede fixed AnimatedDialog scaling 2024-01-13 17:07:32 +01:00
3 changed files with 35 additions and 10 deletions

View file

@ -47,7 +47,7 @@
"film": "Film",
"filmPush": "Film (push)",
"filmPull": "Film (pull)",
"filmReciprocityHint": "Applies correction for shutter speeds grater than 1 second",
"filmReciprocityHint": "Applies correction for shutter speeds greater than 1 second",
"equipmentProfileName": "Equipment profile name",
"equipmentProfileNameHint": "Praktica MTL5B",
"equipmentProfileAllValues": "All",
@ -112,4 +112,4 @@
"tooltipUseLightSensor": "Use lightsensor",
"tooltipUseCamera": "Use camera",
"tooltipOpenSettings": "Open settings"
}
}

View file

@ -191,7 +191,6 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
onDismiss: close,
builder: widget.closedChild != null && widget.openedChild != null
? (_) => _AnimatedSwitcher(
sizeAnimation: _sizeAnimation,
closedOpacityAnimation: _closedOpacityAnimation,
openedOpacityAnimation: _openedOpacityAnimation,
closedSize: _sizeTween.begin!,
@ -291,7 +290,6 @@ class _AnimatedOverlay extends StatelessWidget {
}
class _AnimatedSwitcher extends StatelessWidget {
final Animation<Size?> sizeAnimation;
final Animation<double> closedOpacityAnimation;
final Animation<double> openedOpacityAnimation;
final Size closedSize;
@ -300,7 +298,6 @@ class _AnimatedSwitcher extends StatelessWidget {
final Widget openedChild;
const _AnimatedSwitcher({
required this.sizeAnimation,
required this.closedOpacityAnimation,
required this.openedOpacityAnimation,
required this.closedSize,
@ -316,17 +313,21 @@ class _AnimatedSwitcher extends StatelessWidget {
children: [
Opacity(
opacity: closedOpacityAnimation.value,
child: Transform.scale(
scale: sizeAnimation.value!.width / closedSize.width,
child: SizedBox(
width: closedSize.width,
child: FittedBox(
child: SizedBox.fromSize(
size: closedSize,
child: closedChild,
),
),
),
Opacity(
opacity: openedOpacityAnimation.value,
child: openedChild,
child: FittedBox(
child: SizedBox.fromSize(
size: openedSize,
child: openedChild,
),
),
),
],
);

View file

@ -0,0 +1,24 @@
import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:lightmeter/utils/ev_from_bytes.dart';
void main() {
group('evFromImage', () {
test(
'camera_stub_image.jpg',
() {
final bytes = File('assets/camera_stub_image.jpg').readAsBytesSync();
expectLater(evFromImage(bytes), completion(8.25230310752341));
},
);
test(
'no EXIF',
() {
final bytes = File('assets/launcher_icon_dev_512.png').readAsBytesSync();
expectLater(evFromImage(bytes), completion(null));
},
);
});
}