On Wed, 01 Dec 2010 07:01:02 -0600, Annika Westerlaken <[email protected]>
wrote:
Thanks for your input. You're right about the entry being needed in
manifest.xml, that was already taken care of however. I'm sorry for not
being clear enough in my initial message.
If I were to unzip an odt file containing a picture and rename this
picture in content.xml, manifest,xml and the actual file in the Pictures
folder and rezip it, OOo will ask to repair the document when I try to
open it.
If I let OOo repair the document, the filename has been replaced by the
code and the image shows up.
yes OOo internally assigns a numerical filename to avoid name collisions.
If you want to name the ODT as your image, you should catch the image name
before you generate the ODT.
You can assign on the XML a image name but this is only valid within the
context of the document, not the context of the document filesystem.
It is possible that there's yet another reference to the picture
somewhere that I don't know of, but I don't think so. Because when I add
references using the code OOo expects in my so called 'generator', OOo
opens the file without any warnings and shows the picture.
-----Oorspronkelijk bericht-----
Van: Michael Stahl [mailto:[email protected]]
Verzonden: woensdag 1 december 2010 12:44
Aan: [email protected]
Onderwerp: [dev] Re: Code for Pictures
On 01/12/2010 11:35, Annika Westerlaken wrote:
Dear Sir/Madam,
Currently I am working on a project which requires me to rewrite
Writer
documents without opening them.
The next step is to insert a picture, still without opening the
document. The problem is that when I use the original name of the
picture, the document has to be repaired. The picture has been renamed
to a 32 characters code. It seems this specific code is required to
refer to the picture.
i don't think that OOo requires picures to have a specific name.
but i could imagine that when OOo stores a document, it will not use the
original name for pictures, but simply generates a new one.
i have a more plausible explanation why OOo thinks the document is
invalid:
the ODF package contains a file META-INF/manifest.xml.
this file has an entry for every file that is contained in the package.
if there is a file in the package for which no file-entry exists in the
manifest, then OOo will complain about an invalid ODF document.
AFAIK this is a security feature added in OOo 3.2.
if you added the file to the ODF package by hand, perhaps you have
forgotten to add the manifest file entry.
To see how this code is being determined/generated, I have tried
searching the source code. Unfortunately, I have no idea where to
look.
So I was hoping if someone could either point me in the right
direction,
or answer my question directly.
Many thanks in advance for your assistance in this.
Sincerely,
Annika
--
Alexandro Colorado
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]