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.

2

How to export real image not binary code

By
ivan
on 4/3/13, 6:36 AM 2,309 views

When export contact list to excel file, as for face picture How to export real image not binary code

So was this the kind of answer you were looking for?

Martin
on 5/4/13, 8:34 AM
4

Martin

--Martin--
1978
| 5 6 8
Cornwall, Canada
--Martin--

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin
On 4/3/13, 9:02 PM

To my knowledge the export capability of OpenERP does not include saving as an image.

However, depending on your set up and programming skills, it does not need to be problem at all.

You can try the following:

First, export a single contact, specifying only Image as the output. You will get a comma separated file (CSV) like this :

"id","image"
"__export__.res_partner_194","/9j/4AAQSkZJR . . . huge length of junk ....M53T8z/2Q=="

Next you should edit it with a very simple editor, that saves without adding any formatting at all. Delete everything before the /9j/. Also, delete the double quote at the very end. You want to save only the part that begins with /9j/ and ends with ==. Like this:

/9j/4AAQSkZJR . . . huge length of junk ....M53T8z/2Q==

Save that as a new file called myContact.b64.

Now open this URL : http://i-tools.org/base64

Where it says Download result? choose "Yes, download." Now you can browse to find your file myContact.b64. With that selected, choose Decode and save the resulting file. It will save it as myContact.dat.

Open myContact.dat in an image editor and there you go.

If you have a "good" Linux distribution it probably already has a tool called "base64". Type the following at a command prompt to find out . . .

base64 --version

. . . if you get something like . . .

base64 (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Simon Josefsson.

. . . then you can run . . .

base64 --ignore-garbage -d myContact.b64 > myContact.dat

You can then see your image myContact.dat in any image editor or viewer, and refer to it in your reports.

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: 4/3/13, 6:36 AM
Seen: 2309 times
Last updated: 3/16/15, 8:10 AM