Skip to content

Commit b7a4367

Browse files
committed
Migrate from image_gallery_saver to gal
image_gallery_saver 2.0.3 -> gal 2.3.1 `image_gallery_saver` as been compromised and hasn't been update since 2 years. Gal (https://pub.dev/packages/gal) is the recommended alternative. Rewrote part of `downloadImage` to use gal, removed file naming.
1 parent 8820dc4 commit b7a4367

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

lib/network/images.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:extended_text/extended_text.dart';
66
import 'package:file_picker/file_picker.dart';
77
import 'package:flutter/foundation.dart';
88
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
9-
import 'package:image_gallery_saver/image_gallery_saver.dart';
9+
import 'package:gal/gal.dart';
1010
import 'package:path/path.dart' as path;
1111
import 'package:path_provider/path_provider.dart';
1212
import 'package:piwigo_ng/models/album_model.dart';
@@ -302,10 +302,7 @@ Future<XFile?> downloadImage(
302302
},
303303
outputPath: localPath,
304304
);
305-
await ImageGallerySaver.saveFile(
306-
localPath,
307-
name: image.name,
308-
);
305+
await Gal.putImage(localPath);
309306
return XFile(localPath);
310307
} on DioException catch (e) {
311308
debugPrint("Download images: ${e.message}");

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies:
5252
flutter_local_notifications: ^17.2.4 # Throws notifications on download or upload
5353
open_filex: ^4.4.0 # Open files with devices apps
5454
workmanager: ^0.5.2 # Background processes (auto upload)
55-
image_gallery_saver: ^2.0.3 # Download images
55+
gal: ^2.3.1 # Download images
5656

5757
# Utils
5858
mime_type: ^1.0.0 # Check mime type of files (differentiate photos from videos)

0 commit comments

Comments
 (0)