Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot identify image file #2

Open
lucidl opened this issue Jan 27, 2013 · 7 comments
Open

cannot identify image file #2

lucidl opened this issue Jan 27, 2013 · 7 comments

Comments

@lucidl
Copy link

lucidl commented Jan 27, 2013

When I installed this addon from this link https://ankiweb.net/shared/info/282798835
and choose "add" -> button with "image occlusion" I get the following error. Where could be the problem? (Ubuntu 12.04)

An error occurred in an add-on. Please contact the add-on author.

Traceback (most recent call last):
File "/home/lucidl/Anki/addons/image_occlusion_2/image_occlusion.py", line 86, in add_notes
self.call_ImageOcc_Editor(image_path)
File "/home/lucidl/Anki/addons/image_occlusion_2/image_occlusion.py", line 98, in call_ImageOcc_Editor
d = svgutils.image2svg(path)
File "/home/lucidl/Anki/addons/image_occlusion_2/svgutils.py", line 54, in image2svg
im = Image.open(im_path)
File "/home/lucidl/Anki/addons/image_occlusion_2/Imaging/PIL/Image.py", line 1980, in open
raise IOError("cannot identify image file")
IOError: cannot identify image file

@oli-ver
Copy link

oli-ver commented Jan 27, 2013

I'm just a user, so just suggesting ;-)
Did you try different pictures? "cannot identify image file" sounds like you tried to use an image format ImageOcc cannot understand.

Regards,

Oliver

@lucidl
Copy link
Author

lucidl commented Jan 27, 2013

I'm doing everything as in this tutorial http://youtu.be/2xYWIv8ksqg .The problem happens short after time 2:19 I click on "image occlusion" button as in the video and at this moment the exception is raised. There is no image selected yet.

@oli-ver
Copy link

oli-ver commented Jan 27, 2013

Tried it in my Ubuntu 12.04 VM.
I could add one of the Cards with Image Occlusion without any problems.
I had a picture saved in clipboard.

After that I wanted to choose a picture from a folder. When I clicked on the "Image Occlusion" button I got exactly the same error message. Trying for another time it worked again perfectly...

Now, after restarting Anki I got the error message all the time.

I opened a terminal and updated the system:

  sudo apt-get update
  sudo apt-get upgrade
  sudo reboot

And ... it did not work either.

I opened the python-Skript that is shown in the error message (you will have to change it to your user):

gedit /home/oliver/Anki/addons/image_occlusion_2/Imaging/PIL/Image.py

Then I used the menu function to navigate to line 1980 (Ctrl+i).
I did not understand the reason to raise the IOError there, so I deleted the whole line

 raise IOError("cannot identify image file")

and saved.

Now it works... Don't ask me why ;-)
Checked it with images in clipboard and images from files.

I hope this will help,

Regards,

Oliver

@lucidl
Copy link
Author

lucidl commented Jan 28, 2013

The commenting of line
1980: raise IOError("cannot identify image file")
was the first thing I did then and it did not helped then.
But now I did it again and it helped. It works now, maybe it's because I installed the addon svg-edit (http://code.google.com/p/svg-edit/) in Firefox.

@oli-ver
Copy link

oli-ver commented Jan 28, 2013

Well, I didn't install anything, just Ubuntu 12.04 and all updates and Anki. But anyway, it works! That counts ;)

@elrob
Copy link

elrob commented Mar 28, 2013

I have the same issue except commenting out the line in Image.py did not solve the issue, it just caught errors elsewhere.
If I delete the add-on, restart anki, add the add-on, restart anki then I can make 1 image occlusion. When I attempt to make a second one, I get this error even if I restart anki.
Rob

@elrob
Copy link

elrob commented Mar 31, 2013

I can confirm I get this error on ubuntu installed at uni, and on linux mint (basically ubuntu) at home. However, I don't get this problem on windows. I'm now forced to use windows as I've really got into making image occlusion cards. It's a great add-on but it would be much better if this error didn't occur on linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants