views:

46

answers:

1

I need to embed images inside OpenOffice Text documents without the help of OpenOffice itself. For that I need to work directly inside the zip archive and modify the appropriate xml files. The problem I have now is that OpenOffice stores embedded pictures inside a picture folder and asigns a unique name to them according to the information in the picture.

Filenames look as following:

10000000000000FF000000D84ABBAECB.jpg

This filename is divided into 4 parts at 8 Byte per part and ending with the file extension.

10000000 000000FF 000000D8 4ABBAECB
^        ^        ^        ^
unknown  height   width    checksum

My problem now is that I have no clue what kind of checksum algorithm is used.

+1  A: 

A quick check of the specification reveals no special rules for naming embedded pictures. I guess you can name them however you like (within sensible boundaries).

ammoQ
While this is true I have the problem that, when the template is opened in OpenOffice, the embedded pictures will be renamed. This makes it hard to identify specific pictures later, if I have saved them under an other name.
Aurril
Have you checked that OpenOffice.org keeps the filenames in templates if they conform to their internal name format? If not, you have to look for another way to identify your images anyway.
ammoQ
Yes I have checked this. The same file is always named the same way internally. Despite the fact when I add it or in which document I add it. If it is inserted directly in the archive with its original name (let's say abc.jpeg) and the all xml files are changed accordingly, it will show in OpenOffice. But after the next save of the document in OO the internal name will be given to the file.
Aurril