View Single Post
Old 04-22-2019, 02:00 PM   #3
nirosan
Member
nirosan began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jul 2017
Device: epub
Thank you for quick reply.

I changed it to:
Quote:
print("BookContainer: ", self.bk)
image_path = get_abspath_of_rendered_file()
print("Image path: ", image_path)
f = open(image_path, 'rb')
img = f.read()
f.close()
print("Img: ", img)
self.bk.addfile("MathmMlid", "MathMLImage.png", img, "image/png")
But the plugin crashed:
Quote:
Launcher process crashed
BookContainer: <bookcontainer.BookContainer object at 0x000001927B1F42E8>
Image path: C:\Users\NiroBala\AppData\Local\sigil-ebook\sigil\plugins\AddMath\util\rendered.png
Img: b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\ x0e\x00\x00\x00\x0b\x04\x03\x00\x00\x00\xbd\xab\xa 1Q\x00\x00\x000PLTE\xff\xff\xff\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00/\xdd\xa0{\x00\x00\x00\x0ftRNS\x00\x10\x89\x99f2\xd dDT\xcd"v\xab\xef\xbb\xd4\xa5x\xe1\x00\x00\x00\tpH Ys\x00\x00\x0e\xc4\x00\x00\x0e\xc4\x01\x95+\x0e\x1 b\x00\x00\x00WIDAT\x08\x1dc``TVr`\x00\x82\xb0\x02\ x86$\x06\x16\x06\xd6\x1f\x0c\x0c\xfd\x02\x15\x0cl\ x13\x18\x18\xd67(0\xec\x07J\xcakm`\x98/\x00\xa4u\x18\x18\xfe\x02\x95\xca\xa720\xdc\x03\xd 1\x06\x0c\x0c/\x81t?\x90^\xbf\x80A\xa8\xe7@#\x03\xeb\xa1\xdd\x0e \\\x93\x1c\x00\xc6\x13\x12\xc0w?R\x9a\x00\x00\x00\ x00IEND\xaeB`\x82'
I will debug more later.

Thank you
nirosan is offline   Reply With Quote