Skip to content

Commit

Permalink
we have to use the bytesperpixel instead of assuming 4!
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@15728 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 27, 2017
1 parent 9ce3d2d commit cdb7471
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/codecs/image_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def get_sub_image(self, x, y, w, h):
#copy to local variables:
pixels = self.pixels
oldstride = self.rowstride
pos = y*oldstride + x*4
newstride = w*4
pos = y*oldstride + x*self.bytesperpixel
newstride = w*self.bytesperpixel
lines = []
for _ in range(h):
lines.append(memoryview_to_bytes(pixels[pos:pos+newstride]))
Expand Down

0 comments on commit cdb7471

Please sign in to comment.