Bug 84494 - FILEOPEN: Possible failure to follow SVG spec, 800 pixels interpreted as 0.8cm
Summary: FILEOPEN: Possible failure to follow SVG spec, 800 pixels interpreted as 0.8cm
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
 
Reported: 2014-09-30 00:54 UTC by Alan Horkan
Modified: 2023-07-09 03:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
contrived draw file expecting pixels as units (53.25 KB, application/vnd.oasis.opendocument.graphics)
2014-09-30 00:54 UTC, Alan Horkan
Details
contrived draw file with measurements specified in pixels (px) (53.25 KB, application/vnd.oasis.opendocument.graphics)
2014-09-30 00:57 UTC, Alan Horkan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Horkan 2014-09-30 00:54:22 UTC
Created attachment 107091 [details]
contrived draw file expecting pixels as units

Problem description: 
images embedded in Draw file not opening at correct scale


I've been working on adding OpenDocument draw compatibility to a program I'm working on and have been adjusting files so that they open correctly in Draw. 

What I've read about SVG says that if no units are specified then pixels (px) will be assumed
http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute

my test files are 
testing22.odg
testing23.odg
(I will attach testing22.odg after submitting the bug report if allowed, it appears I can only attach one file at a time)

both are the same except for one line in 
content.xml
the testing22.odg specifies pixels "px" 
the testing22.odg uses pixels but does specify "px", as follows: 

        <draw:frame draw:layer="layout" svg:width="800" svg:height="800" svg:x="0" svg:y="0">
          <draw:image xlink:href="data/layer1.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" />
        </draw:frame>

Current behavior:
testing22.odg does not appear to work at all, the embedded images do not appear to load
testing23.odg does work, but the embedded image is displayed at 0.8cm

(I've adjusted my code to convert pixels to cm for the purposes of compatibility. I'm only writing here to make sure Draw is behaving according to the standards, maybe I've made an incorrect assumption about how minimal I can get away with my OpenDocument XML being.)

Expected behavior:
If I am interpreting the SVG specification correctly the XML above should have resulted in the image in being displayed at the correct size and should not have been converted into 0.8cm and the failure of my contrived file to load might indicate that Draw is making some incorrect assumptions about units, and falling back to something other than pixels when the units are not specified. 

Operating System: Windows XP
Version: 4.3.0.4 release
Comment 1 Alan Horkan 2014-09-30 00:57:10 UTC
Created attachment 107092 [details]
contrived draw file with measurements specified in pixels (px)

Differs from testing23.odg only in that each unit has px after it. I surprised this didn't work at all, expected the same behaviour from both 

        <draw:frame draw:layer="layout" svg:width="800px" svg:height="800px" svg:x="0px" svg:y="0px">
          <draw:image xlink:href="data/layer1.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" />
        </draw:frame>
Comment 2 Buovjaga 2014-11-14 16:41:10 UTC
Reproduced.

Win 7 64-bit Version: 4.4.0.0.alpha2+
Build ID: b021b5983c62e266b82d9f0c5c6d8d8900553827
TinderBox: Win-x86@39, Branch:master, Time: 2014-11-12_01:10:08
Comment 3 QA Administrators 2015-12-20 16:10:47 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2017-01-03 19:57:28 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2019-12-03 14:21:56 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2021-07-08 12:38:01 UTC
Reproduced in:

Version: 6.2.5.2
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded

and 

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 822f128e734f37ee4de9bf5b62640cbec140701e
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Results:
- testing22.odg does open with the large images, 21.17cm by 21.17cm (Shape 1 and Shape 2)
- testing23.odg shows the issue with the 0.8 cm width and height (for Shape 1 and Shape 2)

Interestingly, saving Shape 2 as SVG results in a file with dimensions 900px by 900px:

<svg version="1.1" baseProfile="basic" id="svg2" xmlns:svg="http://www.w3.org/2000/svg"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="900px" height="900px"
	 viewBox="0 0 900 900" xml:space="preserve">
Comment 7 QA Administrators 2023-07-09 03:16:19 UTC
Dear Alan Horkan,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug