Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Remove unnecessary int to double conversion

ashilkn6842218d2bf6
diff --git a/mobile/lib/models/ffmpeg/ffprobe_props.dart b/mobile/lib/models/ffmpeg/ffprobe_props.dart
index cbe8d98f53..edf6845c7a 100644
--- a/mobile/lib/models/ffmpeg/ffprobe_props.dart
+++ b/mobile/lib/models/ffmpeg/ffprobe_props.dart
@@ -1,10 +1,8 @@
// Adapted from: https://github.com/deckerst/aves
import "dart:developer";
-import "dart:ui";
import "package:collection/collection.dart";
-import "package:flutter/widgets.dart";
import "package:intl/intl.dart";
import "package:photos/models/ffmpeg/channel_layouts.dart";
import "package:photos/models/ffmpeg/codecs.dart";
@@ -35,16 +33,22 @@ class FFProbeProps {
return info.join(' * ');
}
- Size? get videoDimentionsConsideringRotation {
- final int width = int.tryParse(codecWidth ?? '0') ?? 0;
- final int height = int.tryParse(codecHeight ?? '0') ?? 0;
- if (width == 0 || height == 0) return null;
+ Map<String, int>? get videoDimentionsConsideringRotation {
+ final int w = int.tryParse(codecWidth ?? '0') ?? 0;
+ final int h = int.tryParse(codecHeight ?? '0') ?? 0;
+ if (w == 0 || h == 0) return null;
if (rotation != null) {
if ((rotation! ~/ 90).isEven) {
- return Size(width.toDouble(), height.toDouble());
+ return {
+ "width": w,
+ "height": h,
+ };
} else {
- return Size(height.toDouble(), width.toDouble());
+ return {
+ "width": h,
+ "height": w,
+ };
}
}
}