Trying to Convert Odoo Image Binary data into Image File
I am trying to convert binary data to image but facing some hurdles in it . First i had learned that how i can convert binary data to image
with open("imageToSave.jpg", "wb") as imgFile: imgFile.write(base64.b64decode(imagestr))
After that i had found that how odoo's save image binary data in ir.attachement then i had fetched binary data
product_image=self.env['ir.attachment'] product_images=product_image.search([('id','in',p_ids)]) for rec in product_images: print(rec.storefname)
but the binary data which i got by using above code isn't correct
because i am not able to create correct image from it.i also had test it on multi online converts. So if anybody have idea about odoo's binary data then please help me.I will pray for your success.