Removed unused profile_fromstring method#6987
Conversation
|
I just want to let you know that this change broke my code (written a long time ago) because I was using the |
|
Sorry about that, how were you calling it? Pillow's C API is internal and private, and can and will change between versions without deprecation warnings. |
|
Thanks for the fast reply! As it's private, no need to be sorry, this is just normal. I was calling it like this: profile_data = img.info.get('icc_profile')
if profile_data:
profile = ImageCms.core.profile_fromstring(profile_data)I'm still calling profile_data = img.info.get('icc_profile')
if profile_data:
profile_file = io.BytesIO(profile_data)
profile = ImageCms.getOpenProfile(profile_file) |
Sounds like a plan to me. Although for the record, to better match your first code block, you'd want to do |
|
Thanks for the info, but as I'm using |
While ImageCms calls
profile_frombytes,Pillow/src/PIL/ImageCms.py
Lines 187 to 191 in 1457d2c
profile_fromstringis unused.profile_fromstringactually calls the same code asprofile_frombytes.Pillow/src/_imagingcms.c
Lines 963 to 964 in 1457d2c
So this PR removes the
profile_fromstringmethod declaration, and renames the C method tocms_profile_frombytesfor clarity.