diff --git a/lib/screens/creators/publishers.dart b/lib/screens/creators/publishers.dart index cc96720e..a5b155d6 100644 --- a/lib/screens/creators/publishers.dart +++ b/lib/screens/creators/publishers.dart @@ -78,6 +78,7 @@ class EditPublisherScreen extends HookConsumerWidget { result = await cropImage( context, image: result, + replacePath: true, allowedAspectRatios: [ if (position == 'background') CropAspectRatio(height: 7, width: 16) diff --git a/lib/services/file.dart b/lib/services/file.dart index 02b3ff30..1b240c1d 100644 --- a/lib/services/file.dart +++ b/lib/services/file.dart @@ -17,7 +17,7 @@ Future cropImage( BuildContext context, { required XFile image, List? allowedAspectRatios, - bool replacePath = false, + bool replacePath = true, }) async { final result = await showMaterialImageCropper( context, @@ -211,8 +211,9 @@ Completer _processUpload( getTemporaryDirectory() .then((tempDir) { final tempFile = File('${tempDir.path}/temp_upload_$actualFilename'); - tempFile - .writeAsBytes(byteData!) + file + .readAsBytes() + .then((bytes) => tempFile.writeAsBytes(bytes)) .then((_) { fileObj = tempFile; // Call progress start