Hi,

This problem was also reported by Tyler Smith a couple of weeks back. I
confirmed it and did a little checking. Unfortunately I also sort of
promised a patch, which I never got around to. 

Instead, let me report what I've found about the syntax:

It seems LibreOffice 4.1 now requires that draw:frame elements wrapping
images be uniquely named with the draw:name attribute if there's more
than one of them.

Multiple uncaptioned images fail because Org currently wraps them in
frames without these attributes.

e.g. a simple document containing

  [[file:test1.jpg]]

  [[file:test2.jpg]]

results in unnamed image frames, e.g. for the first image of the
example:

  <draw:frame draw:style-name="OrgDisplayImage" 
  svg:width="12.70cm" svg:height="12.70cm" text:anchor-type="paragraph">

  <draw:image xlink:href="Images/0001.jpg" xlink:type="simple"
  xlink:show="embed" xlink:actuate="onLoad"/> 

  </draw:frame>

This now results in a read error in LibreOffice 4.1. LibreOffice uses
draw:name="graphics1", "graphics2" etc. for the draw:frame element when
a picture is inserted, but I think any unique value will do.

The problem does not occur if you add captions to the images. Then the
draw:frame gets a draw:name attribute containing the caption text.

e.g. 

  #+caption: A picture
  [[file:test1.jpg]]

  #+caption: Another picture
  [[file:test2.jpg]]

exports without a problem, because it results in draw:frame elements
like (for the first picture of the example):

  <draw:frame draw:style-name="OrgCaptionedImage" (...)
  draw:name="A picture" text:anchor-type="paragraph">
  ^^^^^^^^^^^^^^^^^^^^^
  
However, this only works as long as each caption is unique. If you have
more than one image with identical #+captions, even if they have different
#+names, you get the read error. 

So we may need a fix for the corner case of identical captions as well.

I haven't checked what other elements may be affected by similar new
requirements besides images.

Yours,
Christian




Reply via email to