burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.19k stars 993 forks source link

Sharing feature #372

Closed anderbytes closed 3 years ago

anderbytes commented 3 years ago

Why there's no "SHARE" method in PhotoEdit besides saveBitmap and saveFile ?

I saw that the app has a "Share" button but it only works after SAVING the image first. Why is that like this? I need to make it possible to startActivity + Intent just after my user edits what he needs, and nothing does the job because the nearest I could get was to try it inside onBitmapReady, but as it is a background thread, often I get an error stating that the DoInBackground suffered from some kind of IndexOfOutBounds error, that same that got corrected in 1.1.0 release.

Has anyone managed to implement some way to "Just Share" the content of the editor? Thanks!

burhanrashid52 commented 3 years ago

What do you mean by sharing ? Sharing edited image to other app ? If yes, we can only share the file path other apps for which we need to save the file before sharing it. That's how google photos do it

anderbytes commented 3 years ago

Ok but what if the editor automatically saves a file in it's CACHE folder in Android, and transparently sends it via Intent, instead of forcing us to manually saving it. Wouldn't it be 100% better?

When you use an app or browser a website, would you think as normal if the website asks you to save the locally when you click on "Share" ?

anderbytes commented 3 years ago

I even programmed to try to send the Intent of sharing on the onBitmapReady of the editor, but the MOMENT is not the best, as the async build is still happening.

Maybe if the cache-saving was done at the OnBitmapReady , and the SHARING using "StartActivity" on the OnPostExecute of the async task, then it may work

burhanrashid52 commented 3 years ago

When you use an app or browser a website, would you think as normal if the website asks you to save the locally when you click on "Share" ?

Sharing link from browser/app and sharing the actual content is different. As I gave example of Google Photos that if photo is not locally present at the time of sharing it downloads the image first and then share it.

The library is focus on making image editing easy. How those image are shared in not much concern of the library. It's the part of the app which uses this library. Hence I wont be suggesting to put this feature the library.

anderbytes commented 3 years ago

Understood