Skip to content

Commit

Permalink
use the correct value for bits-per-pixel with alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 27, 2022
1 parent cf3058c commit c04fe89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xpra/codecs/jpeg/decoder.pyx
Expand Up @@ -285,7 +285,9 @@ def decompress_to_rgb(rgb_format, data, unsigned long alpha_offset=0):
cdef int x, y, alpha_stride
cdef unsigned char* alpha_plane
cdef char alpha_index
bpp = 24
if alpha_offset:
bpp = 32
alpha_index = rgb_format.find("A")
assert alpha_index>=0, "no 'A' in %s" % rgb_format
assert len(rgb_format)==4, "unsupported rgb format for alpha: %s" % rgb_format
Expand Down Expand Up @@ -325,7 +327,7 @@ def decompress_to_rgb(rgb_format, data, unsigned long alpha_offset=0):
elapsed = monotonic()-start
log("decompress jpeg to %s: %4i MB/s (%9i bytes in %2.1fms)",
rgb_format, size/elapsed//1024//1024, size, 1000*elapsed)
return ImageWrapper(0, 0, w, h, memoryview(membuf), rgb_format, 24, stride, planes=ImageWrapper.PACKED)
return ImageWrapper(0, 0, w, h, memoryview(membuf), rgb_format, bpp, stride, planes=ImageWrapper.PACKED)


def selftest(full=False):
Expand Down

0 comments on commit c04fe89

Please sign in to comment.