Skip to content

Commit b94df1a

Browse files
prateekmediaclaude
andcommitted
Update dependencies and changelog for widget improvements
Co-authored-by: Claude <[email protected]> Consolidate widget changes in internal changelog Co-authored-by: Claude <[email protected]> Update internal changes with enhanced widget feature Co-authored-by: Claude <[email protected]> Consolidate widget improvements in internal changelog Co-authored-by: Claude <[email protected]> Update flag notation in internal changelog Co-authored-by: Claude <[email protected]>
1 parent c92c9c9 commit b94df1a

File tree

3 files changed

+20
-62
lines changed

3 files changed

+20
-62
lines changed

mobile/apps/photos/lib/utils/isolate/widget_image_operations.dart

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import 'dart:io';
22
import 'dart:typed_data';
33

4-
import 'package:flutter_image_compress/flutter_image_compress.dart';
54
import 'package:image/image.dart' as img;
65
import 'package:logging/logging.dart';
76

87
final _logger = Logger("WidgetImageOperations");
98

109
class WidgetImageOperations {
1110
static const int kDefaultMaxSize = 1024;
12-
static const int kDefaultQuality = 85;
11+
static const int kDefaultQuality = 100;
1312

1413
/// Process widget image with proper EXIF handling and sizing
1514
/// Runs in isolate via Computer.shared() to avoid blocking UI
@@ -54,48 +53,8 @@ class WidgetImageOperations {
5453
int maxSize,
5554
int quality,
5655
) async {
57-
// Option 1: Use flutter_image_compress (preferred - handles EXIF automatically)
58-
if (imagePath != null) {
59-
try {
60-
final result = await FlutterImageCompress.compressWithFile(
61-
imagePath,
62-
minWidth: maxSize,
63-
minHeight: maxSize,
64-
quality: quality,
65-
autoCorrectionAngle: true, // This applies EXIF orientation!
66-
keepExif: false, // We don't need EXIF in final widget image
67-
);
68-
69-
if (result != null) {
70-
return Uint8List.fromList(result);
71-
}
72-
} catch (e) {
73-
_logger.warning(
74-
"flutter_image_compress failed, falling back to image package", e);
75-
}
76-
}
77-
78-
// Option 2: Use flutter_image_compress with bytes
79-
if (imageBytes != null && imagePath == null) {
80-
try {
81-
final result = await FlutterImageCompress.compressWithList(
82-
imageBytes,
83-
minWidth: maxSize,
84-
minHeight: maxSize,
85-
quality: quality,
86-
autoCorrectionAngle: true, // This applies EXIF orientation!
87-
keepExif: false,
88-
);
89-
90-
return Uint8List.fromList(result);
91-
} catch (e) {
92-
_logger.warning(
93-
"flutter_image_compress with bytes failed, falling back to image package",
94-
e);
95-
}
96-
}
97-
98-
// Option 3: Fallback to image package (requires manual EXIF handling)
56+
// Use image package directly for proper max size control
57+
// flutter_image_compress only has minWidth/minHeight which doesn't limit size properly
9958
if (imageBytes != null || imagePath != null) {
10059
try {
10160
List<int> data;

mobile/apps/photos/pubspec.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,8 @@ packages:
679679
dependency: transitive
680680
description:
681681
path: "flutter/flutter_platform_interface"
682-
ref: "2c0f34797df830ef61e6ed479583b368c342cb37"
683-
resolved-ref: "2c0f34797df830ef61e6ed479583b368c342cb37"
682+
ref: remove-event-sub
683+
resolved-ref: b7aac7903f70dce6d71506e221066af1a53ec7fc
684684
url: "https://github.com/ente-io/ffmpeg-kit"
685685
source: git
686686
version: "0.2.1"
@@ -1420,26 +1420,26 @@ packages:
14201420
dependency: transitive
14211421
description:
14221422
name: leak_tracker
1423-
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
1423+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
14241424
url: "https://pub.dev"
14251425
source: hosted
1426-
version: "11.0.2"
1426+
version: "10.0.9"
14271427
leak_tracker_flutter_testing:
14281428
dependency: transitive
14291429
description:
14301430
name: leak_tracker_flutter_testing
1431-
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
1431+
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
14321432
url: "https://pub.dev"
14331433
source: hosted
1434-
version: "3.0.10"
1434+
version: "3.0.9"
14351435
leak_tracker_testing:
14361436
dependency: transitive
14371437
description:
14381438
name: leak_tracker_testing
1439-
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
1439+
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
14401440
url: "https://pub.dev"
14411441
source: hosted
1442-
version: "3.0.2"
1442+
version: "3.0.1"
14431443
like_button:
14441444
dependency: "direct main"
14451445
description:
@@ -2612,26 +2612,26 @@ packages:
26122612
dependency: "direct dev"
26132613
description:
26142614
name: test
2615-
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
2615+
sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e"
26162616
url: "https://pub.dev"
26172617
source: hosted
2618-
version: "1.26.2"
2618+
version: "1.25.15"
26192619
test_api:
26202620
dependency: transitive
26212621
description:
26222622
name: test_api
2623-
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
2623+
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
26242624
url: "https://pub.dev"
26252625
source: hosted
2626-
version: "0.7.6"
2626+
version: "0.7.4"
26272627
test_core:
26282628
dependency: transitive
26292629
description:
26302630
name: test_core
2631-
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
2631+
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
26322632
url: "https://pub.dev"
26332633
source: hosted
2634-
version: "0.6.11"
2634+
version: "0.6.8"
26352635
thermal:
26362636
dependency: "direct main"
26372637
description:
@@ -2820,10 +2820,10 @@ packages:
28202820
dependency: transitive
28212821
description:
28222822
name: vector_math
2823-
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
2823+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
28242824
url: "https://pub.dev"
28252825
source: hosted
2826-
version: "2.2.0"
2826+
version: "2.1.4"
28272827
vibration:
28282828
dependency: transitive
28292829
description:

mobile/apps/photos/scripts/internal_changes.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- Prateek: (i) Widget improvements - HEIC support for iOS, 6-hour refresh cycle with 10 image cache, circuit breaker protection, optimized hash calculation, higher image quality (1280px), cancellation mechanism. FLAG=enhancedWidgetImage
12
- Neeraj: Simplify location display in file info - show "Location" title with "Add location" chip
23
- Laurens: Fix edge case bug in similar images cache when user hasn't indexed ML yet
34
- Neeraj: (i) Show shared albums in widget selection screen
@@ -10,5 +11,3 @@
1011
- Neeraj: (i) Option to send qr for link
1112
- Neeraj: (i) Debug option to enable logViewer
1213
- Neeraj: Potential fix for ios in-app payment
13-
- Prateek: (i) Optimize album widget hash calculation to use batch query
14-
- Prateek: (i) Fix widget image quality and rotation with isolate-based processing pipeline

0 commit comments

Comments
 (0)