glutanimate / image-occlusion-enhanced

Anki add-on that transforms images into cloze tests
https://ankiweb.net/shared/info/1374772155
Other
400 stars 41 forks source link

Unable to create cards with image occlusion #114

Closed doctorDiddlySquat closed 5 years ago

doctorDiddlySquat commented 5 years ago
Problem description

I have not been using Anki for that long. In fact, image occlusion is my first add-on to download. I had used it once or twice without issue. But while creating cards, I attempted to import a converted PNG file from PDF. I am able to put the image into Anki and place occlusion boxes over parts of the image, but when I go to press "Hide All, Guess One". I am presented with an error.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

I am currently using Anki 2.1 on a Macbook Air, MacOS 10.10.5.

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):

Debug info:
Anki 2.1.15 (442df9d6) Python 3.6.1 Qt 5.9.7 PyQt 5.9
Platform: Mac 10.10.5
Flags: frz=True ao=True sv=1
Add-ons possibly involved: Image Occlusion Enhanced for Anki 21 alpha

Caught exception:
  File "aqt/webview.py", line 322, in handler
  File "/Users/ParkerLW/Library/Application Support/Anki2/addons21/1374772155/add.py", line 268, in <lambda>
    lambda val, choice=choice, close=close: self._onAddNotesButton(choice, close, val))
  File "/Users/ParkerLW/Library/Application Support/Anki2/addons21/1374772155/add.py", line 283, in _onAddNotesButton
    r = gen.generateNotes()
  File "/Users/ParkerLW/Library/Application Support/Anki2/addons21/1374772155/ngen.py", line 87, in generateNotes
    omask_path = self._saveMask(self.new_svg, self.occl_id, "O")
  File "/Users/ParkerLW/Library/Application Support/Anki2/addons21/1374772155/ngen.py", line 399, in _saveMask
    mask_file = open(mask_path, 'wb')
<class 'PermissionError'>: [Errno 1] Operation not permitted: '1cb63f7d59b44135b2f66256cf1c8df8-ao-O.svg'
If you are using Anki 2.0

Please open Anki, go to Help → About, find the two lines starting with Version: and Qt, and copy-paste them between the backticks below:

Please fill in details about your operating system (Windows/macOS/Linux, which version):

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

Error 
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. 
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site. 
glutanimate commented 5 years ago

Hi. From the error message it sounds like a permission problem with your Anki media collection folder. So I guess the best thing to ask would be:

What happens if you drag and drop an image onto a regular Anki note (e.g. the "Front" field on a Basic note, or the "Cloze" field on a cloze note). Do you see any error message there? What if you copy and paste the image from a web browser into a field instead? (Right click on any image in our web browser of choice, select "Copy image", then go back to Anki, select the "Front" field for instance, and Ctrl+V / Cmd + V to paste the image.

Please let me know if either of these interaction paths produce any error messages and we can go from there.

doctorDiddlySquat commented 5 years ago

Hi,

Actually yes, I receive a similar error message when dragging an image from the desktop. I will attempt to copy and paste from a web browser.

Thanks!

Parker

On Sep 1, 2019, at 9:14 AM, Aristotelis notifications@github.com wrote:

Hi. From the error message it sounds like a permission problem with your Anki media collection folder. So I guess the best thing to ask would be:

What happens if you drag and drop an image onto a regular Anki note (e.g. the "Front" field on a Basic note, or the "Cloze" field on a cloze note). Do you see any error message there? What if you copy and paste the image from a web browser into a field instead? (Right click on any image in our web browser of choice, select "Copy image", then go back to Anki, select the "Front" field for instance, and Ctrl+V / Cmd + V to paste the image.

Please let me know if either of these interaction paths produce any error messages and we can go from there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/glutanimate/image-occlusion-enhanced/issues/114?email_source=notifications&email_token=ANB4PT75DG3QFJKKIBIG45LQHPS6HA5CNFSM4ISXFQCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5UFQ4I#issuecomment-526932081, or mute the thread https://github.com/notifications/unsubscribe-auth/ANB4PTZ5RZOHO4Y43A2Z6GDQHPS6HANCNFSM4ISXFQCA.

doctorDiddlySquat commented 5 years ago

I also received the same message when pasting from an online source.

Is there a way to allow Anki permission to these sources for images?

On Sep 1, 2019, at 9:14 AM, Aristotelis notifications@github.com wrote:

Hi. From the error message it sounds like a permission problem with your Anki media collection folder. So I guess the best thing to ask would be:

What happens if you drag and drop an image onto a regular Anki note (e.g. the "Front" field on a Basic note, or the "Cloze" field on a cloze note). Do you see any error message there? What if you copy and paste the image from a web browser into a field instead? (Right click on any image in our web browser of choice, select "Copy image", then go back to Anki, select the "Front" field for instance, and Ctrl+V / Cmd + V to paste the image.

Please let me know if either of these interaction paths produce any error messages and we can go from there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/glutanimate/image-occlusion-enhanced/issues/114?email_source=notifications&email_token=ANB4PT75DG3QFJKKIBIG45LQHPS6HA5CNFSM4ISXFQCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5UFQ4I#issuecomment-526932081, or mute the thread https://github.com/notifications/unsubscribe-auth/ANB4PTZ5RZOHO4Y43A2Z6GDQHPS6HANCNFSM4ISXFQCA.

glutanimate commented 5 years ago

Hi Parker,

To be quite honest, I'm not sure what's going on here. The media folder should be user-writable. Since this appears to be a general issue with your Anki installation, my recommendation would be to post on the official support forums: https://anki.tenderapp.com/discussions/ankidesktop. Damien (Anki's creator) is usually very responsive.

Either way, I hope I could help a bit at least.

I'm closing this issue report for now, as the problem is not specific to the add-on.