bugMyPaint - Bugs: bug #18884, Mypaint can't save my images...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #18884: Mypaint can't save my images (*.ora)

Submitted by:  Han-Bit Kang <paraxite>
Submitted on:  Sun 30 Oct 2011 03:19:48 AM UTC  
 
Severity: 4 - ImportantPriority: 5 - Normal
Status: Works For MePrivacy: Public
Assigned to: Till Hartmann <tillux>Open/Closed: Open
Release: 0.9.1Planned Release: None
Operating System: Windows7

(Jump to the original submission Jump to the original submission)

Thu 06 Dec 2012 07:25:04 PM UTC, comment #6:

"Perhaps it's time to get Python to open() the output stream and pass the file handle/descriptor/whatever on to the C code somehow?"

I've had that thought, too. I would even go as far as calling python's f.write() function on the PyObject * from C code, if we can't get an OS independent file descriptor.

Martin Renold <martinxyz>
Project Administrator
Thu 06 Dec 2012 06:24:01 PM UTC, comment #5:

Can you try to reproduce with the current git at all? I'm marking it as not a Blocker, given that it only affects Windows.

Thinking for this one we should at least introduce some debugging output so that when it happens again we at least dump out the user's sys.getfilesystemencoding(). In this case, I'm guessing something like UTF-16 for Korean, noting that u"\ub0ad\uc7d1\ubafb" looks plausible ("낭쟑뫻"), but I'm not seeing any BOM on it (which is what .encode would normally put there). Guessing a bit here.

I'll see if I can force a non-UTF8 filename encoding on my system here.

Internally, MyPaint has been using the proper Unicode strings. All the way up to trying to write files, it seems. Perhaps it's time to get Python to open() the output stream and pass the file handle/descriptor/whatever on to the C code somehow?

Andrew Chadwick <achadwick>
Project Administrator
Mon 05 Dec 2011 01:40:32 PM UTC, comment #4:

Tried out the portable X-MyPaint 0.9.1 version. STILL having the problem. I'm suspecting there's a problem with my computer, not MyPaint...

Traceback (most recent call last):
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\gui\filehandling.py", line 312, save_cb(no details)
if not self.filename:
self.save_as_cb(action)
else:
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\gui\filehandling.py", line 369, save_as_cb(no details)
else:
self.save_file(filename, **options)
break
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\gui\drawwindow.py", line 43, wrapper(self=<gui.filehandling.FileHandler object>, args=(u'I:\\helloworld.ora',), *kwargs={})
try:
func(self, args, *kwargs)
finally:
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\gui\filehandling.py", line 241, save_file(no details)
raise document.SaveLoadError, _('Did not save, the canvas is empty.')
self.doc.model.save(filename, **options)
except document.SaveLoadError, e:
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\document.py", line 262, save(no details)
try:
save(filename, **kwargs)
except gobject.GError, e:
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\document.py", line 393, save_ora(self=<lib.document.Document instance>, filename=u'I:\\helloworld.ora', options=None)
x, y, w, h = l.surface.get_bbox()
el = add_layer(x-x0, y-y0, opac, l.surface, 'data/layer%03d.png' % idx, l.name, l.visible, rect=(x, y, w, h))
# strokemap
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\document.py", line 374, add_layer(x=0, y=0, opac=1.0, surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface *' at 0x03A8BE30> >, name='data/layer000.png', layer_name='', visible=True, rect=(128, -64, 768, 640))
stack.append(layer)
store_surface(surface, name, rect)
a = layer.attrib
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\document.py", line 366, store_surface(surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface *' at 0x03A8BE30> >, name='data/layer000.png', rect=(128, -64, 768, 640))
t1 = time.time()
surface.save(tmp, *rect)
print ' %.3fs surface saving %s' % (time.time() - t1, name)
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\tiledsurface.py", line 181, save(no details)
kwargs['alpha'] = True
pixbufsurface.save_as_png(self, filename, args, *kwargs)
File "I:\X-MyPaint_0.9.1_rev4\Bin\MyPaint\library.zip\lib\pixbufsurface.py", line 135, save_as_png(surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface ' at 0x03A8BE30> >, filename='c:\\users\\\xb0\xad\xc7\xd1\xba\xfb\\appdata\\local\\temp\\tmpaelmq6mypaint\\tmp.png', rect=(128, -64, 768, 640), **kwargs={'alpha': True})
filename_sys = filename.encode(sys.getfilesystemencoding()) # FIXME: should not do that, should use open(unicode_object)
mypaintlib.save_png_fast_progressive(filename_sys, w, h, alpha, render_tile_scanline)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 9: unexpected code byte

Han-Bit Kang <paraxite>
Mon 05 Dec 2011 01:35:23 PM UTC, comment #3:

Changed to MyPaint 1.0 version, still having the problem.

Traceback (most recent call last):
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 427, save_cb(no details)
if not self.filename:
self.save_as_cb(action)
else:
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 451, save_as_cb(no details)
else:
self.save_as_dialog(self.save_file, suggested_filename = current_filename)
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 511, save_as_dialog(no details)
else:
save_method_reference(filename, **options)
break
File "C:\Program Files\MyPaint\library.zip\gui\drawwindow.py", line 46, wrapper(self=<gui.filehandling.FileHandler object>, args=(u'C:\\Users\\\uac15\ud55c\ube5b\\Desktop\\\ub0b4 \uadf8\ub9bc\ub4e4\\helloworld.ora',), *kwargs={})
try:
func(self, args, *kwargs)
# gtk main loop may be called in here...
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 278, save_file(no details)
def save_file(self, filename, export=False, **options):
thumbnail_pixbuf = self.save_doc_to_file(filename, self.doc, export=export, **options)
if not export:
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 311, save_doc_to_file(no details)
w, h = tiledsurface.N, tiledsurface.N # TODO: support for other sizes
thumbnail_pixbuf = doc.model.save(filename, feedback_cb=self.gtk_main_tick, **options)
self.lastsavefailed = False
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 367, save(no details)
try:
save(filename, **kwargs)
except gobject.GError, e:
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 486, save_ora(self=<lib.document.Document instance>, filename=u'C:\\Users\\\uac15\ud55c\ube5b\\Desktop\\\ub0b4 \uadf8\ub9bc\ub4e4\\helloworld.ora', options=None, **kwargs={'feedback_cb': <function gtk_main_tick>})
t0 = time.time()
tempdir = tempfile.mkdtemp(u'mypaint')
# use .tmp extension, so we don't overwrite a valid file if there is an exception
File "tempfile.pyo", line 316, mkdtemp(no details)
<source context missing>
File "ntpath.pyo", line 108, join(no details)
<source context missing>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 9: invalid start byte

And got a new problem with the new 1.0 version:
MyPaint doesn't same my UI settings, so I have to turn my brush, layer, color selector etc. windows manually everytime I restart MyPaint. This is the error message I get everytime I quit MyPaint.
Traceback (most recent call last):
File "C:\Program Files\MyPaint\library.zip\gui\drawwindow.py", line 905, quit_cb(no details)
self.app.doc.model.split_stroke()
self.app.save_gui_config() # FIXME: should do this periodically, not only on quit
File "C:\Program Files\MyPaint\library.zip\gui\application.py", line 387, save_gui_config(no details)
gtk.accel_map_save(join(self.confpath, 'accelmap.conf'))
self.save_settings()
File "C:\Program Files\MyPaint\library.zip\gui\application.py", line 163, save_settings(self=<gui.application.Application instance>)
self.brushmanager.save_brush_history()
self.filehandler.save_scratchpad(self.scratchpad_filename)
save_config()
File "C:\Program Files\MyPaint\library.zip\gui\drawwindow.py", line 46, wrapper(self=<gui.filehandling.FileHandler object>, args=(u'C:\\Users\\\uac15\ud55c\ube5b\\AppData\\Local\\mypaint\\scratchpads\\autosave.ora',), *kwargs={})
try:
func(self, args, *kwargs)
# gtk main loop may be called in here...
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 300, save_scratchpad(no details)
w, h = tiledsurface.N, tiledsurface.N # TODO: support for other sizes
thumbnail_pixbuf = self.save_doc_to_file(filename, self.app.scratchpad_doc, export=export, **options)
if not export:
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 311, save_doc_to_file(no details)
w, h = tiledsurface.N, tiledsurface.N # TODO: support for other sizes
thumbnail_pixbuf = doc.model.save(filename, feedback_cb=self.gtk_main_tick, **options)
self.lastsavefailed = False
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 367, save(no details)
try:
save(filename, **kwargs)
except gobject.GError, e:
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 486, save_ora(self=<lib.document.Document instance>, filename=u'C:\\Users\\\uac15\ud55c\ube5b\\AppData\\Local\\mypaint\\scratchpads\\autosave.ora', options=None, **kwargs={'feedback_cb': <function gtk_main_tick>})
t0 = time.time()
tempdir = tempfile.mkdtemp(u'mypaint')
# use .tmp extension, so we don't overwrite a valid file if there is an exception
File "tempfile.pyo", line 316, mkdtemp(no details)
<source context missing>
File "ntpath.pyo", line 108, join(no details)
<source context missing>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 9: invalid start byte

Han-Bit Kang <paraxite>
Sat 03 Dec 2011 11:59:27 AM UTC, comment #2:

Works for me, I can save non-ascii filenames on Windows Vista without problem. Tested with MyPaint 1.0.

Martin Renold <martinxyz>
Project Administrator
Sun 30 Oct 2011 08:52:53 PM UTC, comment #1:

This seems to be an encoding related issue.
And this is probably the culprit:
"filename_sys = filename.encode(sys.getfilesystemencoding()) # FIXME: should not do that, should use open(unicode_object)"

Till Hartmann <tillux>
Project MemberIn charge of this item.
Sun 30 Oct 2011 03:19:48 AM UTC, original submission:

It's my first time using this program. Saves fine in .png and .jpeg format. Plz fix.

Traceback (most recent call last):
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 312, save_cb(no details)
if not self.filename:
self.save_as_cb(action)
else:
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 369, save_as_cb(no details)
else:
self.save_file(filename, **options)
break
File "C:\Program Files\MyPaint\library.zip\gui\drawwindow.py", line 43, wrapper(self=<gui.filehandling.FileHandler object>, args=(u'C:\\Users\\\uac15\ud55c\ube5b\\Desktop\\dddd.ora',), *kwargs={})
try:
func(self, args, *kwargs)
finally:
File "C:\Program Files\MyPaint\library.zip\gui\filehandling.py", line 241, save_file(no details)
raise document.SaveLoadError, _('Did not save, the canvas is empty.')
self.doc.model.save(filename, **options)
except document.SaveLoadError, e:
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 262, save(no details)
try:
save(filename, **kwargs)
except gobject.GError, e:
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 393, save_ora(self=<lib.document.Document instance>, filename=u'C:\\Users\\\uac15\ud55c\ube5b\\Desktop\\dddd.ora', options=None)
x, y, w, h = l.surface.get_bbox()
el = add_layer(x-x0, y-y0, opac, l.surface, 'data/layer%03d.png' % idx, l.name, l.visible, rect=(x, y, w, h))
# strokemap
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 374, add_layer(x=0, y=0, opac=1.0, surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface *' at 0x035AF680> >, name='data/layer000.png', layer_name='', visible=True, rect=(64, 0, 704, 512))
stack.append(layer)
store_surface(surface, name, rect)
a = layer.attrib
File "C:\Program Files\MyPaint\library.zip\lib\document.py", line 366, store_surface(surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface *' at 0x035AF680> >, name='data/layer000.png', rect=(64, 0, 704, 512))
t1 = time.time()
surface.save(tmp, *rect)
print ' %.3fs surface saving %s' % (time.time() - t1, name)
File "C:\Program Files\MyPaint\library.zip\lib\tiledsurface.py", line 181, save(no details)
kwargs['alpha'] = True
pixbufsurface.save_as_png(self, filename, args, *kwargs)
File "C:\Program Files\MyPaint\library.zip\lib\pixbufsurface.py", line 135, save_as_png(surface=<lib.tiledsurface.Surface; proxy of <Swig Object of type 'TiledSurface ' at 0x035AF680> >, filename='c:\\users\\\xb0\xad\xc7\xd1\xba\xfb\\appdata\\local\\temp\\tmpoxnuqwmypaint\\tmp.png', rect=(64, 0, 704, 512), **kwargs={'alpha': True})
filename_sys = filename.encode(sys.getfilesystemencoding()) # FIXME: should not do that, should use open(unicode_object)
mypaintlib.save_png_fast_progressive(filename_sys, w, h, alpha, render_tile_scanline)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 9: unexpected code byte

Han-Bit Kang <paraxite>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by achadwick (Posted a comment)
  • -unavailable- added by martinxyz (Posted a comment)
  • -unavailable- added by tillux (Posted a comment)
  • -unavailable- added by paraxite (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 06 Dec 2012 06:24:01 PM UTCachadwickSeverity5 - Blocker=>4 - Important
    Sat 03 Dec 2011 11:59:27 AM UTCmartinxyzStatusNone=>Works For Me
    Sun 30 Oct 2011 08:52:53 PM UTCtilluxAssigned toNone=>tillux
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup