hi Till I finally had time to check your patches.
It looks good to me and as soon as http://jens.triq.net/thumbnail-spec/modifications.html is also implemented this can go into master. Below are only some minor points. - One of the commit messages has a too long summary (just add two newlines). - I think the guideline asks us to check for a 256x256 thumbnail before we start to generate a 128x128 one. Would be nice to have this. - As I said on IRC, no point to safe only .ora thumbnails I think. On Sun, Jul 04, 2010 at 03:17:49PM +0200, Till Hartmann wrote: > I'm not sure what will happen on Windows. I know there are gtk apps > storing preferences etc. in ".hidden" folders, even though they are > visible in Windows. Yes probably not nice, but considering all the crash / showstopper bugreports we get from Windows users, I have no problem if mypaint just creates a silly folder. This is better than to have special-case code that no developer is really willing to test/maintain. > --- a/gui/filehandling.py > +++ b/gui/filehandling.py > @@ -254,36 +254,39 @@ class FileHandler(object): > def update_preview_cb(self, file_chooser, preview): > filename = file_chooser.get_preview_filename() > pixbuf = self.get_preview_image(filename) > - preview.set_from_pixbuf(pixbuf) > - file_chooser.set_preview_widget_active(pixbuf != None) > + if pixbuf: > + if os.path.splitext(filename)[1].lower() == ".ora": #only store > .ora thumbnails > + helpers.save_freedesktop_thumbnail(pixbuf, filename) > + pixbuf = helpers.pixbuf_thumbnail(pixbuf, 128, 128, True) > + preview.set_from_pixbuf(pixbuf) > + file_chooser.set_preview_widget_active(True) > + else: > + pass Ideally we would set some "broken thumbnail" image, or just all-blank. > def get_preview_image(self, filename): > [...] > + try: > + [...] > + try: > + data = ora.read("Thumbnails/thumbnail.png") > + except KeyError: > + return None No need to catch that one, with the outer try: in place, I think. -- Martin Renold _______________________________________________ Mypaint-discuss mailing list [email protected] https://mail.gna.org/listinfo/mypaint-discuss
