Bug 67312 - Other: Insert picture luminance 0% (images/pictures dark in MS Office 2013 Word) - compatibility
Summary: Other: Insert picture luminance 0% (images/pictures dark in MS Office 2013 Wo...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.4.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-25 16:27 UTC by Philip Smith
Modified: 2013-08-07 12:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Smith 2013-07-25 16:27:10 UTC
Problem description: 

If a libreoffice .odt including pictures is read in Office 2013 Word, all images appear dark.

This problem gives an immediate and obvious compatibility failure between LibreOffice and Word.

Looking at the content.xml a typical image is coded like this:

<style:graphic-properties fo:border="0.01042in none" fo:background-color="transparent" style:wrap="parallel" style:wrap-contour="false" fo:clip="rect(0in, 0in, 0in, 0in)" style:horizontal-rel="paragraph" style:vertical-rel="paragraph" style:horizontal-pos="center" style:vertical-pos="top" draw:luminance="0%" draw:contrast="0%" draw:image-opacity="100%"/>

where the luminance and contrast are "0%".

With Word 2010 the images look OK.
With Word 2013 the images look very dark.

In ODF 1.1, "The attribute draw:luminance specifies a signed percentage value that affects the output luminance of a bitmap or raster graphic".
So 0% (or 50%) might be considered mid-range for ODF 1.1.

In ODF 1.2, "Luminance is a data type zeroToHundredPercent",
so should be 50% to be mid-range.

This behaviour is present in 4.0 and 4.1.

Word 2013 may have a bug in that for ODF 1.1 it interprets 0% to mean dark for a signed percentage and for ODF 1.2 it interprets 0% to mean dark for a 0-100 percentage.
This depends on what "normal/unchanged" is for a picture as a signed and unsigned percentage.

Note that a Luminance of 50% would be interpreted by Word 2013 as 0% in its scale of -100% to 100%).

The fix is to NOT write luminance and contrast to the .odt so no adjustment is made by other wordprocessors and no mis-interpretation of 0% or 50% can be made. Other wordprocessors will not adjust the brightness and will use a sensible default of "no change").

Steps to reproduce:
1. Edit a new document in libreoffice writer
2. Insert a .png picture
3. Save as ODF 1.2 default .odt
4. Check inside the .odt and read the content.xml, search for luminance
5. Load the .odt file into MS Office 2013 Word
6. Image appears dark
7. Right-click [Format picture] [Picture Tab] [Picture Corrections]
8. "Brightness" is seen to be -50%
9. Change brightness to 0%
10. Image appears OK
11. Manually edit content.xml and change luminance to 50%
12. Image appears OK in LibreOffice and Word 2013

Current behavior:
Luminance for an included picture is set to 0% (in an ODF scale of 0% to 100%) which seems a little low and which Word 2013 interprets as -50% in its scale of -100% to 100%. If the luminance is manually edited to 50%, Word 2013 interprets this a 0% and the pictures look OK.

Expected behavior:
Images inserted with default luminance should not be dark in Word 2013.
Operating System: Fedora
Version: 4.0.4.2 release
Comment 1 Joel Madero 2013-08-06 20:58:03 UTC
Looks like MSO is playing nasty tricks - it seems fine in MSO 2010 + we can't do anything about what they do with odt files. ODT standard is open and set by a committee - MS has the duty to implement the standards correctly, if they fail to do so - it's their problem not ours. 

If the problem exists for xls or xlsx then it becomes a different story as that's their standard which we have to comply with but with odt, they must comply with standards, you should email them and let them know they appear to be failing here.
Comment 2 Philip Smith 2013-08-07 12:56:59 UTC
Agreed.

Here is a more accurate description for others who will see the same problem reading into Word 2013 an .odt document containing images ...

The ODF OpenDocument-v1.2-part1 does confuse things somewhat: it is inconsistent as pointed out in https://tools.oasis-open.org/issues/browse/OFFICE-3821

OpenDocument-v1.2-part1 20.135 draw:luminance specifies,
"The draw:luminance attribute specifies a *signed* percentage value ... The draw:luminance attribute has the data type zeroToHundredPercent 18.3.41" where
"18.3.41" specifies an *unsigned* 0 to 100%.

So I think "zeroToHundredPercent" should be changed to "signedzeroToHundredPercent" or "percent" in the specification.

Luminance is correctly described as a signed percentage from -100% to +100% with default 0 in:
http://books.evc-cit.info/odbook/book.html

MS Word 2013 should not adjust images with luminance of 0%.

MS Word 2013 has a bug in that it reads .odt 1.2 documents containing images and subtracts 50% from the luminance (default 0) of the .odt images making them -50% which is dark. If there is no luminance it works OK.

A temporary workaround is to edit the brightness of each image in Word 2013 after opening the document to set each brightness to 0.
Another workaround is just to remove the luminance from the odt file's content.xml (which appears to be not needed if 0) before importing into Word 2013 and Word will assume it is not to be altered.