Closed iqfareez closed 7 months ago
Hi @iqfareez . Thanks for your contributionš¤ First, there are some limitations depending on the platform.
iOS/macOS does not allow us to get the direct file path of a media file, so you have to get the local URL e.g. file:///var/mobile/Media/DCIM/118APPLE/IMG_8371.MOV
. In addition, this is not possible with NSPhotoLibraryAddUsageDescription, which would require additional permissions.
file paths and URLs cannot be used permanently as they can be changed by the system or the user.
changes to media files should always be made via the platform's API and should not be changed or deleted directly using the path.
I would like my app to have function to open image directly quickly after saving.
Does this mean opening the Gallery app? If not, the easiest way seems to be to display the images using the path to the temporary directory used to store the files.
final imagePath = '${Directory.systemTemp.path}/image.jpg';
await Dio().download('$url',imagePath);
await Gal.putImage(imagePath);
// Open imagePath //
If you tell me more about your Use Case, I may be able to suggest a better way.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, Thanks for your contribution.
Hi, I do have a usecase. I am building a share to instagram story functionality and on Android it's limited, it requires passing a file from MediaStore instead of the app's cache.
I am using Gal for a different functionality, so it would be great to be able to use the same one here
Did you check the documentation and it did not help?
Proposal
Hi. Great project! Currenty
putImage
andputImageBytes
both return void after saving the image to gallery. I would like for the function to return the saved image path. I saw similar issue #203 but had no idea it was marked as completed, apologize if there is already a discussion that I may overlooked.Use case
I would like my app to have function to open image directly quickly after saving.