mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-25 17:30:23 +00:00
dynamically getting colors, instead of setting it to 255
This commit is contained in:
parent
b96a3f53a5
commit
ff07e4e247
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ def img_to_fobj(img, format, **kwargs):
|
|||
|
||||
#preserve transparency if the image is in Pallette (P) mode
|
||||
if img.mode == 'P':
|
||||
kwargs['transparency'] = 255
|
||||
kwargs['transparency'] = len(img.split()[-1].getcolors())
|
||||
else:
|
||||
img.convert('RGB')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue