@@ -6,10 +6,8 @@ import 'package:device_info_plus/device_info_plus.dart';
66import 'package:dio/dio.dart' ;
77import 'package:flutter/material.dart' ;
88import 'package:flutter/services.dart' ;
9- import 'package:flutter_image_compress/flutter_image_compress.dart' ;
109import 'package:flutter_secure_storage/flutter_secure_storage.dart' ;
1110import 'package:image_picker/image_picker.dart' ;
12- import 'package:path_provider/path_provider.dart' ;
1311import 'package:permission_handler/permission_handler.dart' ;
1412import 'package:piwigo_ng/app.dart' ;
1513import 'package:piwigo_ng/components/dialogs/confirm_dialog.dart' ;
@@ -93,13 +91,7 @@ Future<List<int>> uploadPhotos(
9391
9492 // Creates Upload Item list for the upload notifier
9593 for (var photo in photos) {
96- File ? uploadFile;
97-
98- // Compress file
99- uploadFile = await compressFile (photo);
100- if (uploadFile == null ) {
101- uploadFile = File (photo.path);
102- }
94+ File ? uploadFile = File (photo.path);
10395
10496 items.add (UploadItem (
10597 file: uploadFile,
@@ -242,43 +234,6 @@ Future<Response?> uploadChunk({
242234 );
243235}
244236
245- /// Compress before upload, enabled with [Preferences.getCompressUpload] parameter.
246- Future <File ?> compressFile (XFile file) async {
247- try {
248- SharedPreferences prefs = await SharedPreferences .getInstance ();
249-
250- // Get original file path
251- final filePath = file.path;
252-
253- // Directory output
254- var dir = await getTemporaryDirectory ();
255-
256- // Extract file name and extension
257- final String filename = filePath.split ('/' ).last;
258-
259- // Output file path
260- final outPath = "${dir .absolute .path }/$filename " ;
261-
262- // Get compress parameters
263- double quality = prefs.getDouble (Preferences .uploadQualityKey) ?? 1.0 ;
264- bool removeMetadata = prefs.getBool (Preferences .removeMetadataKey) ?? false ;
265-
266- // Compress with quality parameter and exif metadata
267- var result = await FlutterImageCompress .compressAndGetFile (
268- filePath,
269- outPath,
270- quality: (quality * 100 ).round (),
271- keepExif: removeMetadata,
272- );
273-
274- debugPrint ("Upload Compress $result " );
275- return result;
276- } catch (e) {
277- debugPrint (e.toString ());
278- }
279- return null ;
280- }
281-
282237Future <bool > uploadCompleted (List <int > imageId, int categoryId) async {
283238 SharedPreferences prefs = await SharedPreferences .getInstance ();
284239 Map <String , String > queries = {
0 commit comments