fix VImage.PIL_mode_from_vips()

thanks Alessandro
This commit is contained in:
John Cupitt 2013-06-07 10:42:47 +01:00
parent d13ff241c5
commit 5d7f19beb3
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
7/6/13 started 7.34.0
- version bump
- oops, VImage.PIL_mode_from_vips() failed for CMYK, thanks Alessandro
12/3/13 started 7.33.0
- vipsthumbnail lets you specify the sharpening mask

View File

@ -194,9 +194,9 @@ public:
def PIL_mode_from_vips (vim):
if vim.Bands () == 3 and vim.BandFmt () == VImage.FMTUCHAR:
return 'RGB'
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type == VImage.VImage.RGB:
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type () == VImage.RGB:
return 'RGBA'
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type == VImage.CMYK:
elif vim.Bands () == 4 and vim.BandFmt () == VImage.FMTUCHAR and vim.Type () == VImage.CMYK:
return 'CMYK'
elif vim.Bands () == 1 and vim.BandFmt () == VImage.FMTUCHAR:
return 'L'