fluttercandies / saver_gallery

MIT License
16 stars 16 forks source link

[Bug report] saving an image into gallery loses quality #15

Closed joaquingrech closed 1 month ago

joaquingrech commented 4 months ago

Version

latest

Platforms

iOS

Device Model

iphone 14

flutter info

all good

How to reproduce?

I download a picture from the internet and save it to the gallery. For some reason, using the package the quality lost is huge. I even tried with 98% at quality, which should give a perfect representation and it looks like it is set at 40%... horrible results. I tested on Android and it seems ok, this seems to be a problem only with iOS. The file I download is a .webp image.

Logs

no need

Example code (optional)

// Fetching the image from the internet
      var response = await http.get(Uri.parse(imageUrl));
      if (response.statusCode == 200) {
         // Saving the image to the gallery
        SaveResult result = await SaverGallery.saveImage(
            Uint8List.fromList(response.bodyBytes),
            quality: 98,
            name: 'temp.webp',
            androidExistNotSave: true);

Contact

No response

zhangruiyu commented 4 months ago

saveImageToGallery will convert to jpg, which is exactly what happens, so you can use saveFileToGallery