What is the naming convention for images in the Pictures folder of an odt

What is the naming convention for images in the odt Pictures folder.
I need to build odt files where there are hundreds of png files that are autogenerated.

There is no special requirement for the names, you may use whatever names you want. LibreOffice itself uses names generated from hashes of the images, which helps in deduplication of identical images.

@mikekaganski Incorrect. The file name of the pictures contain some form of hash of the file’s contents. This way LO can deduplicate images.

What is the format?

Incorrect what? Did you read? The standard does not impose any requirements to names. LibreOffice will also read any filenames (so @howard_lightstone, who needed to generate ODTs themselves) could decide for themselves, and got the answer. But LibreOffice writes hashes - and uses that to deduplicate images. So again: incorrect what?

Not sure why my email is on this question.

Because you get emails for any activity happening in your question on Ask site - people writing here don’t even put emails, all notifications are done automatically.

Interesting since I don’t recall ever asking that question and have been semi-retired since 2016.
How do I delete any such question?

Your profile on Ask allows you to configure notifications; you likely can also change the email (and have it point to some trash bin). It is also possible to ask admins to remove your account - if you really need that - but I hope that simply configuring notifications would be enough.

Thanks, I finally got it resolved (Single Signon problem).

And, I asked the original question in 2021 (during Covid boredom) while I was editing some old documentation with hundreds of images (looking for a lazy way to edit). Who remembers that far back?

@mikekaganski My conclusion is based on the following behaviour I have observed:

  1. I unpacked the odt file to its folder (using unzip)
  2. I renamed a single image in the Pictures/ folder (just changed one digit in its filename)
  3. I modified the content.xml to fix the reference to that image.
  4. I zipped back the file (using the syntax zip -r - . | dd of=~/document-with-pictures.odt)
  5. Tried to open. Libre office reports that the document is broken and offers a repair.

Repair is successful, but unfortunately I do not see a way to automate it in the headless environment I use, so getting a “broken” document is not an option for me.

If I instead of repair, redo the steps 1-5, but this time I put the correct digit in the file name, I get no complaints when opening the document.

What about \META-INF\manifest.xml ?

3 Likes

Your conclusions (which are expressed in absolutely assured way) are wrong, and based on not knowing the ODF package structure. While not knowing that is OK, claiming stuff like you did is not. You surely could ask instead, like “I did this, and I see that. What do I do wrong?”

See @sokol92’s note.

2 Likes

@mikekaganski I agree with you, sorry. That was my confirmation bias in action.

And you were right: I did miss changing the reference in the /META-INF/manifest.xml. After doing that, LibreOffice no longer complains.

Sorry for my inappropriate comment before.

Thank you all for help!!