Converting hex data to image

Ali Sajadian sajadian.ali at gmail.com
Mon Feb 1 02:19:31 EST 2021


dimplem... at gmail.com در تاریخ سه‌شنبه ۱۲ مارس ۲۰۱۹ ساعت ۱۳:۰۱:۴۵ (UTC+3:30) نوشت:
> On Tuesday, March 12, 2019 at 2:53:49 PM UTC+5:30, Peter Otten wrote: 
> > dimplem... at gmail.com wrote: 
> > 
> > >> Save the image to a file (in binary mode!) and then try to open it with 
> > >> an image viewer. The data may be corrupted. 
> > > 
> > > When i tried doing that it says Invalid Image... 
> > 
> > So it looks like the problem occurs somewhere before you are decoding the 
> > image with the PIL...
> This is what i am doing : 
> for associate in self.conn.response[:-1]: 
> attributes = associate['attributes'] 
> obj = { 
> 'img':attributes['thumbnailPhoto'],} 
> This img i am calling in my view and writing to the file...

Hi could you solve this problem dimplem?
I have exactly the same issue when I read thumbnailPhoto from active directory


More information about the Python-list mailing list