xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 3 years ago

#934 closed defect (fixed)

Pillow errors with Ubuntu Vivid

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: blocker Milestone: 0.16
Component: encodings Version: 0.15.x
Keywords: Ubuntu Pillow Cc:

Description (last modified by Antoine Martin)

Found on an up to date vivid 64-bit system:

2015-07-30 13:37:42,939 PIL_encode((314, 283, 'webp', '355448 bytes', 'RGBA', 1256)) converting to RGBA failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/codecs/pillow/encode.py", line 69, in encode
    im = PIL.Image.frombuffer(rgb, (w, h), pixels, "raw", pixel_format, image.get_rowstride())
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2119, in frombuffer
    core.map_buffer(data, size, decoder_name, None, 0, args)
TypeError: must be sequence of length 3, not 2

and

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/server/source.py", line 1837, in encode_loop
    fn_and_args[0](*fn_and_args[1:])
  File "/usr/lib/python2.7/dist-packages/xpra/server/window_source.py", line 1320, in make_data_packet_cb
    packet = self.make_data_packet(damage_time, process_damage_time, wid, image, coding, sequence, options, flush)
  File "/usr/lib/python2.7/dist-packages/xpra/server/window_source.py", line 1669, in make_data_packet
    ret = encoder(coding, image, options)
  File "/usr/lib/python2.7/dist-packages/xpra/server/window_source.py", line 1752, in webp_encode
    return webp_encode(coding, image, self.rgb_formats, self.supports_transparency, q, s, options)
  File "/usr/lib/python2.7/dist-packages/xpra/server/picture_encode.py", line 72, in webp_encode
    return enc_pillow.encode(x, image, quality, speed, supports_transparency)
  File "/usr/lib/python2.7/dist-packages/xpra/codecs/pillow/encode.py", line 69, in encode
    im = PIL.Image.frombuffer(rgb, (w, h), pixels, "raw", pixel_format, image.get_rowstride())
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2119, in frombuffer
    core.map_buffer(data, size, decoder_name, None, 0, args)
TypeError: must be sequence of length 3, not 2

and

2015-07-30 18:48:53,010 draw error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/client/ui_client_base.py", line 2054, in _do_draw
    window.draw_region(x, y, width, height, coding, data, rowstride, packet_sequence, options, [record_decode_time])
  File "/usr/lib/python2.7/dist-packages/xpra/client/client_window_base.py", line 462, in draw_region
    self._backing.draw_region(x, y, width, height, coding, img_data, rowstride, options, callbacks)
  File "/usr/lib/python2.7/dist-packages/xpra/client/window_backing_base.py", line 488, in draw_region
    self.paint_webp(img_data, x, y, width, height, options, callbacks)
  File "/usr/lib/python2.7/dist-packages/xpra/client/window_backing_base.py", line 245, in paint_webp
    buffer_wrapper, width, height, stride, has_alpha, rgb_format = dec_webp.decompress(img_data, has_alpha, options.get("rgb_format"))
AttributeError: 'NoneType' object has no attribute 'decompress'

and

2015-07-30 18:48:54,669 gtk2.GLWindowBacking(1, (499, 316), YUV444P).gl_paint_planar(..) error: ("No array-type handler for type <type 'memoryview'> (value: <memory at 0x7f6a000d20e8>) registered", <OpenGL.GL.images.ImageInputConverter object at 0x7f6a028480d0>)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 695, in gl_paint_planar
    self.update_planar_textures(x, y, enc_width, enc_height, img, pixel_format, scaling=(enc_width!=width or enc_height!=height))
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 749, in update_planar_textures
    glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width//div_w, height//div_h, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixel_data)
  File "/usr/lib/python2.7/dist-packages/OpenGL/latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "/usr/lib/python2.7/dist-packages/OpenGL/wrapper.py", line 782, in wrapperCall
    pyArgs = tuple( calculate_pyArgs( args ))
  File "/usr/lib/python2.7/dist-packages/OpenGL/wrapper.py", line 355, in calculate_pyArgs
    yield converter(args[index], self, args)
  File "/usr/lib/python2.7/dist-packages/OpenGL/GL/images.py", line 400, in __call__
    return arrayType.asArray( arg )
  File "/usr/lib/python2.7/dist-packages/OpenGL/arrays/arraydatatype.py", line 141, in asArray
    return cls.getHandler(value).asArray( value, typeCode or cls.typeConstant )
  File "/usr/lib/python2.7/dist-packages/OpenGL/arrays/arraydatatype.py", line 52, in __call__
    typ, repr(value)[:50]

Change History (4)

comment:1 Changed 3 years ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 3 years ago by Antoine Martin

Description: modified (diff)

comment:3 Changed 3 years ago by Antoine Martin

  • r10160 should take care of the dec_webp being None: the vivid build chroot doesn't have webp, so dec_webp support was not built and we should fallback to Pillow (we now do). The changeset also adds the ability to test this codepath more easily with the env var XPRA_WEBP_PILLOW=1
  • No array-type handler for type <type 'memoryview'> is probably only triggered with trunk (which is the first release to build with memoryview enabled by default) - less ugent
  • the error in core.map_buffer is more obscure and the code was lifted from "picture_encode" to the new pillow encoder, so this may affect older branches too - more urgent

comment:4 Changed 3 years ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

r10172 fixes the memoryview error, which only happens on clients without opengl accelerate. (may backport)

As for TypeError: must be sequence of length 3, not 2, I am now unable to reproduce it. r10177 improved the error logging, so if it does occur again, we'll have more details on what is wrong.

Closing for now.

Note: See TracTickets for help on using tickets.