Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to import image? how to solve 'Incorrect padding'

By
MacKan
on 10/31/13, 3:38 AM 2,479 views

i download product details from openerp. In that csv file i get image in binary format. When i try to upload data again some of the rows showing padding error ( Incorrect padding ). How to s solve this issue?

its a base64 decode error. i try to decode binary image value to .decode('base64') it show same error. how to solve this ?

MacKan
on 10/31/13, 4:40 AM
0
Daniel Kauffman
On 11/5/14, 2:22 AM

When exporting images directly from PostgreSQL, convert PostgreSQL's bytea format to base64 using the following in the query:

select encode("product_product"."image",'base64') as "image" from "product_product";

Using .decode('base64') in Python will not work because the data first needs to be decoded from PostgreSQL's bytea format.

See also https://www.odoo.com/forum/help-1/question/export-external-id-directly-from-database-67297

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 10/31/13, 3:38 AM
Seen: 2479 times
Last updated: 3/16/15, 8:10 AM