Ademking / BetterViewer

a replacement for the image viewing mode built into Firefox and Chrome-based web browsers.
MIT License
252 stars 19 forks source link

add Photopea shortcut #2

Closed bbbenji closed 2 years ago

bbbenji commented 2 years ago

This function may have issues with larger images as they are being sent as URI data in the URL. The reason we cannot pass the original URL to Photopea is twofold.

  1. CORS
  2. any edits made in BetterViewer itself would not be passed along to Photopea

Not exactly sure how to resolve this but I have 2 ideas.

  1. hiding the option to edit in Photopea if the image is over a certain file size
  2. uploading to Imgur first then passing the URL to Photopea (might run into CORS problems)

Let me know if you have any ideas or if this PR requires any changes for a merge.

Ademking commented 2 years ago

@bbbenji You're amazing! I really appreciate your contribution Thanks a lot! Your idea is so cool 👍 You made my day ❤️

This function may have issues with larger images as they are being sent as URI data in the URL. The reason we cannot pass the original URL to Photopea is twofold.

  1. CORS
  2. any edits made in BetterViewer itself would not be passed along to Photopea

Not exactly sure how to resolve this but I have 2 ideas.

  1. hiding the option to edit in Photopea if the image is over a certain file size
  2. uploading to Imgur first then passing the URL to Photopea (might run into CORS problems)

Let me know if you have any ideas or if this PR requires any changes for a merge.

I found a solution:

  1. We upload the image using ImgBB (many users requested to change Imgur with ImgBB) https://api.imgbb.com
  2. We use Photopea to open the uploaded image (No CORS problems found) I've test it and It's working fine 👍

Thank you again for your time and effort! I will add the list of contributors in "About" page.

Ademking commented 2 years ago

@all-contributors please add @bbbenji for code

allcontributors[bot] commented 2 years ago

@Ademking

I've put up a pull request to add @bbbenji! :tada: