Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59448

Converting hex data to image

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <spk265@nyu.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.066
X-Spam-Evidence '*H*': 0.87; '*S*': 0.00; '......': 0.16; 'fetch': 0.16; 'hex': 0.16; 'skip:[ 40': 0.16; 'subject:Converting': 0.16; 'subject:image': 0.16; 'thanks,': 0.17; 'implementing': 0.19; 'skip:{ 20': 0.24; 'appreciated.': 0.29; 'message- id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'actual': 0.34; 'received:209.85': 0.35; 'convert': 0.35; 'received:google.com': 0.35; 'subject:data': 0.36; 'received:209': 0.37; 'server': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:* 10': 0.61; 'user,': 0.69; 'photo': 0.78
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=RoplqwXlVbNaYH3Vs9oC/UZpDuC8VRXVyxmXW+Vk9P0=; b=YeQS63GMbWSP62n0ygAmnszlIR/EAfazdbvUDTmAJACM6Y4K0a5d4MduCvEE49AI6P XXmSuVDJ/Bb6HsAFYkdkCNz9+dBQrKQ1DDD7R05eV3PgtfDtOOuso2GpnIgBqJLK61Ql cLFDb7IaeTjyrlNTa4rV0ZxaEi6YMINPlZvAaXsXzNFTWowZjqqRt/d1m+EbL6axZ0lz AxZSH9sgfiHnU6U77BKmBx3HOyfe9pRYKXMeRXG9+ig5sIP0jNBglFel0uz2uskai+pB Wp2GJwQwbfhtwb4Co5zSqf4penp2L+K9jwu61+YY1rgxp9CwDOfqRqtMKH3pHecgpNos eVJw==
X-Gm-Message-State ALoCoQlQyN+bEVO7tKeqX4q8MLGy782IoAAgPj3BFuUYAiRx8x7IT91EGPuPzzu3MW0bVSOL6BjB
MIME-Version 1.0
X-Received by 10.52.28.243 with SMTP id e19mr1021598vdh.36.1384443172091; Thu, 14 Nov 2013 07:32:52 -0800 (PST)
Date Thu, 14 Nov 2013 10:32:52 -0500
Subject Converting hex data to image
From Shyam Parimal Katti <spk265@nyu.edu>
To python-list@python.org
Content-Type multipart/alternative; boundary=20cf307d06927c35b604eb24cbe9
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2605.1384445043.18130.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384445044 news.xs4all.nl 15915 [2001:888:2000:d::a6]:40207
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59448

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

I am implementing an authentication system(in Django) using LDAP as the
backend(django-auth-ldap). When we fetch the data from the LDAP server for
a particular valid user, the data associated with the user contains the
thumbnail photo in hex representation. E.x.:

[('CN=XX,OU=Users,OU=Accounts,DC=test,DC=com', {'msExchBlockedSendersHash':
['\xce'], 'mailNickname': ['test_user'], 'primaryGroupID': ['513'],
'logonCount': ['1021'], *thumbnailPhoto:
['\xef\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c.....']*......
]

How do I convert the hex data for an image to the actual image?

Any help would be greatly appreciated.


Thanks,
Shyam

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Converting hex data to image Shyam Parimal Katti <spk265@nyu.edu> - 2013-11-14 10:32 -0500

csiph-web