Skip to content

Commit c6a67c6

Browse files
committed
Remove Heic/Heif conversion
1 parent 86a1afc commit c6a67c6

4 files changed

Lines changed: 0 additions & 33 deletions

File tree

lib/services/auto_upload_manager.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:dio/dio.dart';
77
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
88
import 'package:flutter/foundation.dart';
99
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
10-
import 'package:heif_converter/heif_converter.dart';
1110
import 'package:piwigo_ng/models/album_model.dart';
1211
import 'package:piwigo_ng/models/status_model.dart';
1312
import 'package:piwigo_ng/network/api_client.dart';
@@ -91,17 +90,6 @@ class AutoUploadManager {
9190
// Remove folders and links
9291
List<File> files = dirFiles.where((file) => file is File).map<File>((e) => e as File).toList();
9392

94-
// Convert heic/heif files to .jpg
95-
for (File file in files) {
96-
if (file.path.endsWith('.heic') || file.path.endsWith('.heif')) {
97-
debugPrint("${file.path} is Heic/Heif ! Converting to jpg... ");
98-
String? jpgPath = await HeifConverter.convert(file.path, format: 'jpg');
99-
if (jpgPath != null) {
100-
files.remove(file);
101-
files.add(File(jpgPath));
102-
}
103-
}
104-
}
10593
debugPrint("List files: ${files.toString()}");
10694
await autoUploadPhotos(files);
10795
return true;

lib/utils/image_actions.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:io';
22

33
import 'package:flutter/material.dart';
44
import 'package:flutter_image_compress/flutter_image_compress.dart';
5-
import 'package:heif_converter/heif_converter.dart';
65
import 'package:image_picker/image_picker.dart';
76
import 'package:path_provider/path_provider.dart';
87
import 'package:piwigo_ng/components/dialogs/confirm_dialog.dart';
@@ -71,11 +70,6 @@ Future<List<XFile>?> onPickImages() async {
7170
if (Preferences.getAvailableFileTypes
7271
.contains(file.name.split('.').last)) {
7372
files.add(file);
74-
} else if (file.name.endsWith('.heic') || file.name.endsWith('.heif')) {
75-
String? jpgPath = await HeifConverter.convert(file.path, format: 'jpg');
76-
if (jpgPath != null) {
77-
files.add(XFile(jpgPath));
78-
}
7973
}
8074
}
8175
return files;
@@ -100,12 +94,6 @@ Future<XFile?> onTakePhoto(BuildContext context) async {
10094
imageQuality: (Preferences.getUploadQuality * 100).round(),
10195
requestFullMetadata: !Preferences.getRemoveMetadata,
10296
);
103-
if (image != null) {
104-
String? jpgPath = await HeifConverter.convert(image.path, format: 'jpg');
105-
if (jpgPath != null) {
106-
image = XFile(jpgPath);
107-
}
108-
}
10997
break;
11098
case 1:
11199
image = await _picker.pickVideo(source: ImageSource.camera);

pubspec.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,6 @@ packages:
565565
url: "https://pub.dev"
566566
source: hosted
567567
version: "2.1.3"
568-
heif_converter:
569-
dependency: "direct main"
570-
description:
571-
name: heif_converter
572-
sha256: a2fbbf3f795b19753d84a52223c60d3bcf3cf2261d6c0d41857f0ec198e6eef3
573-
url: "https://pub.dev"
574-
source: hosted
575-
version: "1.0.1"
576568
html:
577569
dependency: transitive
578570
description:

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ dependencies:
6262
permission_handler: ^12.0.0+1 # Check and asks for permissions
6363
share_plus: ^12.0.0 # Share files
6464
flutter_cache_manager: ^3.3.0 # Handles network image cache
65-
heif_converter: ^1.0.1 # Convert heic files to jpg
6665
provider: ^6.0.3 # Notifiers for theme and language changes
6766
listen_sharing_intent: ^1.9.2 # Receive sharing from other apps
6867

0 commit comments

Comments
 (0)