Bug Hunting Session
Bug 83662 - Unnamed Writer images, inserted with a script, not visible in Navigator
Summary: Unnamed Writer images, inserted with a script, not visible in Navigator
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2014-09-09 11:17 UTC by Matthew Francis
Modified: 2017-09-16 01:38 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document (29.77 KB, application/vnd.oasis.opendocument.text)
2014-09-09 11:18 UTC, Matthew Francis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Francis 2014-09-09 11:17:36 UTC
Observed on OSX 10.9.4 / LO 4.3.1.2 and 4.4 master

It is possible to create an ODT which contains an image that does not display under "Images" within Navigator. An example is attached which contains two images, only one of which can be seen in Navigator.

(Note: Due to bug 83493, this document may load very slowly due to the presence of externally linked images)


Within the content.xml of the document, the problem appears to relate to the fact that the first <draw:frame> doesn't have a "draw:name" attribute:

            <text:p text:style-name="Standard">
                <draw:frame text:anchor-type="as-char" svg:y="0cm" draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P4" svg:width="3.372cm" svg:height="1.371cm">
                    <draw:image xlink:href="http://ask.libreoffice.org/m/tdf/media/images/tdf-logo.png?v=7" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad">
                        <text:p/>
                    </draw:image>
                </draw:frame>
            </text:p>
            <text:p text:style-name="P3">
                <draw:frame draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char" svg:width="7.853cm" svg:height="3.193cm" draw:z-index="1">
                    <draw:image xlink:href="http://ask.libreoffice.org/m/tdf/media/images/tdf-logo.png?v=7" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
                </draw:frame>
            </text:p>


The problematic image was inserted using a Python script, and it seems likely there's no way of creating such a document using the Writer interface alone.

Possibly the solution is to always generate a name on insertion / file load if it is missing?
Comment 1 Matthew Francis 2014-09-09 11:18:19 UTC
Created attachment 105972 [details]
Sample document
Comment 2 Yousuf Philips (jay) (retired) 2014-09-09 22:00:56 UTC
Hi Matthew,

Here are the files that i mentioned that had image problems in navigator.

attachment 96366 [details] - images having no labels
attachment 105410 [details] [GB_2013.docx] - images not being listed
Comment 3 retired 2014-09-10 05:15:38 UTC
Confirmed:4.3.2.1:OSX
10.9.4.

Navigator shows only one image (the 2nd) instead of two.
-> NEW
Comment 4 Matthew Francis 2014-09-10 12:49:41 UTC
The two .docx mentioned above have a problem in the same category; when an image isn't named within the OOXML of the .docx, the image isn't shown correctly in Navigator.

In the case of import from .docx, it seems that the symptom is slightly different for some images - the image shows as a blank entry in Navigator rather than being missing altogether. Clicking on such broken entries does not select the correct image in the document, but always and only the last such image. In addition, (some?) unnamed images of this sort appear to be automatically assigned a name when saved as ODT (they become images "1", "2", "3", ...), which doesn't happen with the originally attached document.

So, currently:
- Unnamed images can be inserted by macro
- Unnamed images can pass through import filters (which?) without being named
- Some but not all unnamed images get named when they are saved
- Navigator shows some unnamed images as non-functional blank entries, and others not at all


In terms of solutions;

Option 1: Fully allow unnamed images
- Word appears able to have unnamed images in a .docx, so it might be considered reasonable to allow saving them back the same way.
- In this case, Navigator should be made to show all such images in a form that allows them to be interacted with properly.
- At present, you can't create an unnamed image in Writer - deleting the name causes a new one to be inserted automatically when the properties dialog is closed. If they are to be allowed, then this should probably be made possible (the images would have to be given some other placeholder under Navigator).

Option 2: Fully forbid unnamed images
- Macro interactions and all import filters would have to be audited to ensure that all images that are inserted/loaded are named and properly visible in Navigator from birth.
Comment 5 QA Administrators 2017-01-03 19:40:00 UTC Comment hidden (spam)