I'm trying to extract some MathML metadata from EPS or GIFs formats (which are the only two formats I can export equations). I only know the basics of Python so I was searching for a library which would probably have a method that gives me the metadata from the EPS just as you would read it if you open it on a Text editor. Could somebody advise on what I can do to get that?
I've tried the PIL and EXIF python packages but until know I only seem to get binary information which I don't know how to decode.
from exif import Image
file = "myfile.gif"
f = open(file, 'rb')
myeq = Image(f)
myeq.get_file
I got this:
bound method Image.get_file of <exif._image.Image object at 0x033C3750>
I would like something like this:
GIF89af . ð ÿÿÿ , f . ñ„©Ëí£œ´Ú‹³Þ¼÷ †âH–æyz¨¶.žò¬
NLç˜Íð¼œüÃ`×úЦ0èDD8炤][©7aëR¹À®ØðcŠ.á2·˜º5ß
4¸ÝÌ*ícIÚ·‘öCxSB6×W3$˜Øsèˆ(Ù˜Á˜TCÇ'¹iqhÉÉ &§IY7 ¸’·“ú×ÒÚf
£÷y‡zƒÆREk´›û+¼8\ÜiŒœ¬¼ÌܼŒ-=M]=⌽ÍÝíý
n$K.óy¥^.…ÇîñéìLOô¥‰¿3ºË_ÉËP Å]7¯ Â…» !ÿ
MathType001ÿ DSMT7 WinAllBasicCodePages Times New Roman
Symbol Courier Prime MT Extra !/ED/APôG_APòAPô
A ôEô%ôB_A ôC_A ôEô*_HôA ô@ôAHôA*_D_Eô_Eô_A
†"- ƒb †± ±
ƒb ˆ2
†"'- ˆ4 ƒa ƒc
ˆ2 ƒa !ÿMathType003ÿ<?xml version="1.0"?><!--
MathType@Translator@5@5@MathML2 (Clipboard).tdl@MathML 2.0
(Clipboard)@ --><math xmlns='http://www.w3.org/1998/Math/MathML'
<mrow><mfrac><mrow><mo>−</mo><mi>b</mi><mo>±</mo><msqrt>
<mrow><msup><mi>b</mi><mn>2</mn></mšsup><mo>−</mo><mn>4</mn>
<mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi>
</mrow></mfrac></mrow></math><!-- MathType@End@5@5@ --> !ÿ
MathType002;
Here is the EPS in case is useful:
https://drive.google.com/open?id=1Y7WrJK1gmpvqeboFY3OmPYGJqkRptKTY