camilo1498 / stories_editor

This is a package created in the style of the instagram story creator, with which you can create images with images, texts, stickers (Gifs), finger drawing.
Creative Commons Zero v1.0 Universal
121 stars 82 forks source link

iOS : gallery doesn't work (only black screen) #4

Closed Kinomad closed 1 year ago

Kinomad commented 2 years ago

Since this new update (0.1.6), on iOS, it's not possible to access at the gallery like before. After to click on the thumb picture, you just have a black screen with the cancel button and you can't see or access at the gallery with all your own photos and album. So it's not possible to access and play with images.

Is it a new things to do to have access to the media ?
This what I added in my info.plist in the previous version and it's worked fine :

<key>NSPhotoLibraryUsageDescription</key>
<string>Privacy - Photo Library Usage Description</string>
<key>NSMotionUsageDescription</key>
<string>Motion usage description</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>NSPhotoLibraryAddUsageDescription</string>

Thanks by advance :)

camilo1498 commented 2 years ago

ok, I'll check the code snippet from the gallery, it is a possible bug 😅

Kinomad commented 2 years ago

Thanks! Let me know if you need help to test on iOS :)

camilo1498 commented 2 years ago

Hi :D, I can now support iOS (although I am learning), are you testing from an emulator or from a physical device? I have tested it on a physical ipad and everything works fine.

Kinomad commented 2 years ago

Hi Camilo, I tried on device and from an iPhone 12 Pro.
When I clic on thumb image to access at the gallery, I only have a black screen and cancel button. I can wait a while but nothing arrive. But if I try to tap under or around the cancel button, it's awake the black screen and I can see a gallery with all my photos (just the quality is poor but it's work fine and I can choose a picture).

Kinomad commented 2 years ago

Sorry Camillo, I made new test today and forget what I said about this clic on the black screen. In fact, it's just very long loading to get the gallery (I have to wait around 12 seconds to get images). The previous galley system was quicker and had loading progress bar. Maybe you need just to add a loading bar and improve the performance of the gallery...

camilo1498 commented 2 years ago

I have done several tests on the iphone emulators and also on the physical ipad and everything works correctly, I don't know what could be the cause of that error, but I will keep checking.

I have already uploaded a new version to the repository where you can define the quality of the image with the parameter galleryThumbnailQuality by default it is 200 and it works fine up to 400

Kinomad commented 2 years ago

Hi Camillo, thanks a lot for your several test and time on it!

I think is according the number of picture in your phone. I have a lot of pictures in my gallery, it's can explain the gap betwen my phone and your tests. You have just few demos pictures with emulator and mostly of time, iPad don't have so many pictures like an usual phone. I tried to launch my test outside of my projet and without a debug mode, but the pblm is the same, I have to wait around 12 secondes. In the previous gallery, at was bit long too but not so much (around 4 seconds).

Super cool to have this new option galleryThumbnailQuality, thanks :) How I can configure my .yaml to load directly from your repository please and try that ?

camilo1498 commented 2 years ago

mmm ok, i have ~8.000 images on my ipad, i'll try to find that issue. and you need to configure your .yaml like this:

stories_editor:
    git:
      path: https://github.com/camilo1498/stories_editor.git

later i'll update on pub.dev

Kinomad commented 2 years ago

Thanks for the .yaml setup :)

Kinomad commented 2 years ago

Hi Camilo,

I updated to 0.1.8 to test the gallery picker, the problem is still here (need around 15 seconds to get gallery), maybe this error message can help you to fix it :

2022-03-01 18:42:37.522516+0100 Runner[1799:643081] [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: setState() called after dispose(): _GalleryMediaPickerState#b4eee(lifecycle state: defunct, not mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1085:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1120:6)
#2      _GalleryMediaPickerState._refreshPathList.<anonymous closure> (package:gallery_media_picker/gallery_media_picker.dart:163:7)
#3      _rootRunUnary (dart:async/zone.dart:1434:47)
<asynchronous suspension>

To give you more information : 1/ I tried on the last iPad mini with only 10 pictures, there is no problems with gallery, but the sharing option doesn't work (nothing happen when you clic on it 2/ I tried on my iPhone 12 Pro (109 000 photos / 31 000 videos), more than 15 seconds to get images 3/ I tried on iPhone XR (23 500 photos / 5 700 videos), it's take 7 seconds to shows gallery

Hope all that can help you. Stephane

intellign commented 1 year ago

check out my forked version