Skip to content

Commit

Permalink
Version 4.0.12
Browse files Browse the repository at this point in the history
    - Fix loading not RGB(a) images
    - Pillow 4.2 changed api
  • Loading branch information
sergey-dryabzhinsky committed Aug 10, 2017
1 parent 7e445b0 commit 1c4994c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Comix 4.0.12

- Fix loading not RGB(a) images
- Pillow 4.2 changed api

Comix 4.0.11

- speedup 7z and rar extraction - extract all files,
if archive solid - extract one file is SLOW

Comix 4.0.10

- fix load of lzma/7z archives - new version 7z generates archives not compatible with old pylzma
- fix load of thumbnails if no images loaded of archive not opened

Comix 4.0.9

- Quick fix opening encrypted archives (with password).
Expand Down
2 changes: 1 addition & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import portability

VERSION = '4.0.11'
VERSION = '4.0.12'
HOME_DIR = portability.get_home_directory()
CONFIG_DIR = portability.get_config_directory()
DATA_DIR = portability.get_data_directory()
9 changes: 8 additions & 1 deletion src/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,15 @@ def get_most_common_edge_colour(pixbuf):

def pil_to_pixbuf(image):
"""Return a pixbuf created from the PIL <image>."""
imagestr = image.tostring()
IS_RGBA = image.mode == 'RGBA'
if image.mode not in ('RGB', 'RGBA'):
image = image.convert('RGB')
try:
imagestr = image.tostring()
except:
imagestr = image.tobytes()
else:
raise ValueError("Image object not PIL object? Or not compatible!")
return gtk.gdk.pixbuf_new_from_data(imagestr, gtk.gdk.COLORSPACE_RGB,
IS_RGBA, 8, image.size[0], image.size[1],
(IS_RGBA and 4 or 3) * image.size[0])
Expand Down

0 comments on commit 1c4994c

Please sign in to comment.