Bug 94656 - Inserted images have 0 width in LO-damaged .ods file that opens with LO3.3
Summary: Inserted images have 0 width in LO-damaged .ods file that opens with LO3.3
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.4.0 release
Hardware: All All
: low normal
Assignee: Not Assigned
Keywords: filter:ods, preBibisect, regression
Depends on:
Blocks: Calc-Images
  Show dependency treegraph
Reported: 2015-09-30 22:12 UTC by Paul Hutchinson
Modified: 2020-04-07 11:33 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Does not load/display images in column D (102.33 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-09-30 22:12 UTC, Paul Hutchinson
Org graphics used to build sheet (58.74 KB, application/x-7z-compressed)
2015-10-05 17:39 UTC, Paul Hutchinson
Does load images in column D if resaved in LO3.3 (97.33 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-07 11:33 UTC, Timur

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hutchinson 2015-09-30 22:12:19 UTC
Created attachment 119152 [details]
Does not load/display images in column D

A simple spreadsheet was made with simple text in the first 3 columns.  In column D a picture was inserted for each row.  The image was them anchored to the cell.  After the file was saved and then reloaded the images are not displayed (not loaded?).

The file was then loaded into excel which loaded everything fine.  A copy was saved from excel and loaded into LibreOffice which then loaded the file correctly.
Comment 1 raal 2015-10-01 11:22:21 UTC Comment hidden (obsolete)
Comment 2 Paul Hutchinson 2015-10-01 22:00:13 UTC
Retested with same result.
Comment 3 Paul Hutchinson 2015-10-01 22:05:39 UTC
Hi raal,

Just noticed a difference between the two versions.  When saving the file out again the old version kept the images, but dropped the images from the file (at least Excel didn't load them anymore).
Comment 4 raal 2015-10-02 05:45:16 UTC Comment hidden (obsolete)
Comment 5 tommy27 2015-10-03 09:27:50 UTC Comment hidden (obsolete)
Comment 6 Paul Hutchinson 2015-10-05 17:39:36 UTC
Created attachment 119315 [details]
Org graphics used to build sheet
Comment 7 Paul Hutchinson 2015-10-05 17:46:42 UTC
The org spreadsheet was made by importing a .csv file with the file names in column A, a 4 number with spaces between them in column B.

The file names where sorted in column A (reordering the whole spreadsheet).

Column C then had the graphic inserted using Insert->Image... for each file.  The Anchor was then changed to cell.

A new column C was inserted.

The spreadsheet was them saved out and an attempt was made to reload the file (into an empty spreadsheet)
Comment 8 Buovjaga 2015-10-08 08:59:38 UTC
I tried inserting two of the images to a new spreadsheet. The images did not disappear after save & reload.

attachment 119152 [details] can be unzipped and the files seen in Pictures folder.

Win 7 Pro 64-bit, Version: (x64)
Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe
Locale: fi-FI (fi_FI)
Comment 9 Paul Hutchinson 2015-10-08 20:20:55 UTC
I tried the following with the latest Libreoffice:

 * Loaded the original .ods file into Excel (file1).
 * Saved it back out (file2)
 * Loaded that into Libreoffice (file2)
 * Saved it back out (file3)
 * Closed Libreoffice
 * Loaded the new file back in (file3)
 * Loaded without issue.

It looks like the question is now why does Excel load the file but Libreoffice does not.

Was the .ods file corrupted by the older version of Libreoffice or is there a loading problem with the current version of Libreoffice

If it's a corrupted file, the question is should Libreoffice load it anyway as Excel does.
Comment 10 Buovjaga 2015-10-09 05:21:50 UTC
Yeah, let's set to NEW and focus on why the images are not displayed even though they live inside the document container.
Comment 11 JoNi 2016-04-22 20:57:35 UTC
the images are still there:
* open navigator sidebar
* click in the sheet
* navigator shows Image 1 to 21
* double click an entry
* switch to properties sidebar
* unfold position and size
* width is 0, the rest looks normal
* increase width to make image visible again

why width is 0?
does lo import the value wrong 
or is width in the document really 0 and should we sanitize the value
Comment 12 JoNi 2016-04-23 08:47:21 UTC
This is what one row looks like: 
> <table:table-cell office:value-type="string" calcext:value-type="string">
>  <text:p>001BC500B0016C1E.bin</text:p>
> </table:table-cell>
> <table:table-cell office:value-type="string" calcext:value-type="string">
>  <text:p>03 05 09 01</text:p>
> </table:table-cell>
> <table:table-cell office:value-type="string" calcext:value-type="string">
>  <text:p>Field of FF&apos;s Damage</text:p>
>  <draw:frame table:end-cell-address="Details.C1" table:end-x="7.8827in" table:end-y="5.9602in" draw:z-index="0" draw:name="Image 1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="7.8827in" svg:height="5.9594in" svg:x="1.7524in" svg:y="0in">
>   <draw:image xlink:href="Pictures/10000000000002CF0000023AFD0A1A6E.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad">
>    <text:p/>
>   </draw:image>
>  </draw:frame>
> </table:table-cell>
> <table:table-cell/>

in the cell of column C is a frame with a width and inside is the picture.
while the cell of column D is empty.

don't know if the frame should be in column D and the document was saved wrong or lo imports it wrong.

needs someone who knows ods specs
Comment 13 Xisco Faulí 2016-09-19 15:29:39 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2018-07-28 02:42:58 UTC Comment hidden (obsolete)
Comment 15 Timur 2020-04-07 11:11:50 UTC
Attachment 119152 [details] no repro LO 3.3, I mark regression from 3.4, repro 7.0+.
If ODS is opened in LO 3.3 and resaved, images open. So likely damaged by LO.

Original ODS has table:end-cell-address="Details.C1" and saved ODS has table:end-cell-address="Details.D2".
Comment 16 Timur 2020-04-07 11:33:40 UTC
Created attachment 159390 [details]
Does load images in column D if resaved in LO3.3

This one further loads and saves fine.