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

'NoneType' object has no attribute 'size' #3

Open
lucidl opened this issue Feb 9, 2013 · 3 comments
Open

'NoneType' object has no attribute 'size' #3

lucidl opened this issue Feb 9, 2013 · 3 comments

Comments

@lucidl
Copy link

lucidl commented Feb 9, 2013

When I choose "add" -> button with "image occlusion" I get the following error. Where could be the problem? (Ubuntu 12.04). Sometimes helpes restarting the computer, sometimes it corrects after some time period, now the problem lasts and I can't get rid off it.

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 55, in image2svg
width, height = im.size
AttributeError: 'NoneType' object has no attribute 'size'

@lucidl
Copy link
Author

lucidl commented Feb 12, 2013

I changed the code as follows: It seems that the problem was something with clipboard.
def add_notes(self):
#clip = QApplication.clipboard()
#if clip.mimeData().imageData():
#handle, image_path = tempfile.mkstemp(suffix='.png')
#clip.image().save(image_path)
#self.image_path = image_path
#clip.clear()
#self.call_ImageOcc_Editor(image_path)

    #else:
    image_path = QtGui.QFileDialog.getOpenFileName(None, # parent
                                                   FILE_DIALOG_MESSAGE,
                                                   os.path.expanduser('~'),
                                                   FILE_DIALOG_FILTER)
    if image_path:
      self.image_path = image_path
      self.call_ImageOcc_Editor(image_path)          

@cicabum
Copy link

cicabum commented Mar 29, 2013

What file should i change? I have the same problem :-(

@lucidl
Copy link
Author

lucidl commented Mar 30, 2013

I commented lines 80 .. 88 in file Anki/addons/image_occlusion_2/image_occlusion.py, you can see them in my previous post (Commented lines begin with #)

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

2 participants