diff --git a/PIL/PyAccess.py b/PIL/PyAccess.py index 8b67a8ea2..2ae881a58 100644 --- a/PIL/PyAccess.py +++ b/PIL/PyAccess.py @@ -289,6 +289,7 @@ mode_map = {'1': _PyAccess8, 'YCbCr': _PyAccess32_3, 'RGBA': _PyAccess32_4, 'RGBa': _PyAccess32_4, + 'BGRa': _PyAccess32_4, 'RGBX': _PyAccess32_4, 'CMYK': _PyAccess32_4, 'F': _PyAccessF, diff --git a/Tests/make_hash.py b/Tests/make_hash.py index 6d700addf..6581e0217 100644 --- a/Tests/make_hash.py +++ b/Tests/make_hash.py @@ -8,7 +8,7 @@ modes = [ "I", "I;16", "I;16L", "I;16B", "I;32L", "I;32B", "F", "P", "PA", - "RGB", "RGBA", "RGBa", "RGBX", + "RGB", "RGBA", "RGBa", "RGBX", "BGRa", "CMYK", "YCbCr", "LAB", "HSV", diff --git a/libImaging/Access.c b/libImaging/Access.c index 059f2aaeb..0a1413358 100644 --- a/libImaging/Access.c +++ b/libImaging/Access.c @@ -14,7 +14,7 @@ /* use Tests/make_hash.py to calculate these values */ #define ACCESS_TABLE_SIZE 27 -#define ACCESS_TABLE_HASH 3078 +#define ACCESS_TABLE_HASH 3154 static struct ImagingAccessInstance access_table[ACCESS_TABLE_SIZE]; @@ -235,6 +235,7 @@ ImagingAccessInit() ADD("RGB", line_32, get_pixel_32, put_pixel_32); ADD("RGBA", line_32, get_pixel_32, put_pixel_32); ADD("RGBa", line_32, get_pixel_32, put_pixel_32); + ADD("BGRa", line_32, get_pixel_32, put_pixel_32); ADD("RGBX", line_32, get_pixel_32, put_pixel_32); ADD("CMYK", line_32, get_pixel_32, put_pixel_32); ADD("YCbCr", line_32, get_pixel_32, put_pixel_32);