Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
8348 Visualizzazioni

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
gen 22
2670
1
mar 20
2299
0
lug 19
2362
2
lug 17
10784
0
ott 15
3159