Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2428 closed defect (fixed)

TB when trying to save avatar

Reported by: dkirov Owned by: asterix
Priority: normal Milestone: 0.11
Component: dialogs Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: OS:

Description

Open profile window, make sure there is no avatar in the vcard, choose an image for avatar, right click -> save as

First, I get warning dialog

Extension not supported

Image cannot be saved in jpeg format. Save as /tmp/dk.jpeg?

click OK and I get this:

Traceback (most recent call last):
  File "/home/kirov/Projects/gajim/trunk/src/gtkgui_helpers.py", line 676, in on_ok2
    pixbuf.save(file_path, 'jpeg')
AttributeError: 'NoneType' object has no attribute 'save'

Change History (6)

comment:1 Changed 10 years ago by nk

this string doesn't make sense:

Image cannot be saved in jpeg format. Save as /tmp/dk.jpeg?

comment:2 Changed 10 years ago by dkirov

indeed.

I think the problem is in the long try: except: block where each error is interpreted as 'invalid image format', while in my case the error is probably: 'there is no such file'. Will have a look later. Ticket is a reminder that something has to be fixed. Steps to reproduce:

  • create a vcard, without avatar
  • open profile window for modification (the avatar button has default image)
  • choose some avatar
  • right click on avatar button -> save as
  • select location and click 'OK'

comment:3 Changed 10 years ago by dkirov

indeed.

I think the problem is in the long try: except: block where each error is interpreted as 'invalid image format', while in my case the error is probably: 'there is no such file'. Will have a look later. Ticket is a reminder that something has to be fixed. Steps to reproduce:

  • create a vcard, without avatar
  • open profile window for modification (the avatar button has default

image)

  • choose some avatar
  • right click on avatar button -> save as
  • select location and click 'OK'

comment:4 Changed 10 years ago by asterix

here it's becasue you have not yet published your vcard, so avatar is not

saved on HD, and save_as gets it from HD. So pixbuf is None. So 2 solutions: before trying to save:

if not pixbuf:

errorDialog("Avatar can't be found")

other solution:

save pixbuf on HD as soon as we select it in FileChooserDialog?

I vote for 1 because we can select an avatar then close window without publishing, so in this case we don't want to save it on HD.

maybe another idea ?

comment:5 Changed 10 years ago by anonymous

Replying to asterix:

maybe another idea ?

disable 'Save as' menuitem, when image is not on HD.

I publish an image by choosing one from my HD, so I don't need to be able

to save it back.

comment:6 Changed 10 years ago by anonymous

  • Status changed from new to closed
Note: See TracTickets for help on using tickets.