Binary Image File in Hexadecimal Format
15 Nov
2001
15 Nov
'01
2:25 p.m.
Hello, I am generating a RTF file from Python 2.1 with Zope 2.4, using the "Rich Text Format (RTF) Version 1.6 Specification" (http://msdn.microsoft.com/library/specs/rtfspec.htm). But I can not include a "jpg" image in the RTF file. For including the "jpg" image file, firstly, I have obtainted the hexadecimal representation of the image with Image.encode("hex") from PIL library: Import Image img = Image.open("photo.jpg") file = open("filename","wb") file.write(img.encode("hex")) file.close() However, this hexadecimal representation is no good, because when, for example, I save the same image with Microsoft Word in RTF format, these representations no match. Anybody can help me ? Thank you very much.
8931
Age (days ago)
8931
Last active (days ago)
0 comments
1 participants
participants (1)
-
Juan Javier Carrera Obrero