Skip to Content
Menu
This question has been flagged
8535 Views

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

84/8468aeff52f5e338dcaf9000cae16013f6ee793b

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.

Avatar
Discard
Related Posts Replies Views Activity
0
Jan 22
2893
1
Mar 20
2403
0
Jul 19
2554
2
Jul 17
11089
0
Oct 15
3329