Bug 143311 - Exported PDF doesn't mark decorative images correctly
Summary: Exported PDF doesn't mark decorative images correctly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.0.6.2 release
Hardware: All All
: medium enhancement
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.6.0 target:7.5.0.0.beta2 inR...
Keywords: accessibility, filter:docx
Depends on:
Blocks: PDF-Accessibility
  Show dependency treegraph
 
Reported: 2021-07-12 11:02 UTC by Martin Josefik
Modified: 2023-08-10 08:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document with a decorative image (33.57 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-12 11:05 UTC, Martin Josefik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Josefik 2021-07-12 11:02:28 UTC
Description:
If I generate a PDF version from DOCX file where an image is marked as decorative, the information about the image being decorative isn't propagated to the exported PDF file.

Decorative image in a PDF file should be marked as Artifact/Background, more info:
https://www.w3.org/TR/WCAG20-TECHS/PDF4
https://etc.usf.edu/techease/4all/web-accessibility/marking-up-decorative-images-in-adobe-acrobat/


Steps to Reproduce:
1. Create docx file containing an image that's marked as decorative.
2. Export PDF file

Actual Results:
Generated PDF contains figure/image tag and Alternative text is empty.

Expected Results:
Decorative image should be correctly marked as Artifact/Background.

See more info at:
https://www.w3.org/TR/WCAG20-TECHS/PDF4
https://etc.usf.edu/techease/4all/web-accessibility/marking-up-decorative-images-in-adobe-acrobat/


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Martin Josefik 2021-07-12 11:05:16 UTC
Created attachment 173503 [details]
Example document with a decorative image
Comment 2 Buovjaga 2021-07-19 11:16:13 UTC
Which software was the DOCX created in (including version)?
How do you mark an image as decorative in this software?
How do you check the actual result? By opening the PDF with a text editor?
Comment 3 Martin Josefik 2021-07-19 13:27:49 UTC
Hi Buovjaga,

Which software was the DOCX created in (including version)?
-> For example MS Word 365, version 16.51

How do you mark an image as decorative in this software?
-> Right click on the image, click on "Edit Alt Text...", small panel pops up on the right, select tick box "Mark as decorative".

How do you check the actual result? By opening the PDF with a text editor?
-> Checked results by Adobe Reader Pro version
Comment 4 Dmitriy Siushkin 2021-07-22 13:37:54 UTC
what is the relationship between the file created in MS Word 365, exported/ opened/checkd by Adobe Reader Pro and LibreOffice?
Comment 5 Buovjaga 2021-07-22 15:19:16 UTC
(In reply to Dmitriy Siushkin from comment #4)
> what is the relationship between the file created in MS Word 365, exported/
> opened/checkd by Adobe Reader Pro and LibreOffice?

You export the example file as PDF from LibreOffice and check it with Adobe Reader Pro (I wonder, if there is some way to check without buying this software?)
Comment 6 Martin Josefik 2021-07-23 08:00:30 UTC
(In reply to Dmitriy Siushkin from comment #4)
> what is the relationship between the file created in MS Word 365, exported/
> opened/checkd by Adobe Reader Pro and LibreOffice?


Hi, Dmitriy: you can create docx/pptx files using MS Word/Powerpoint software and obviusly edit/view such files using LibreOffice. You can also export to PDF files and others. This bug is created for the scenario where:

- Create a docx document with an image in it. Mark it as decorative using Office 365 Word (I attached a document as example)
- Open said document in LibreOffice, export to PDF by steps: Export As > Export As PDF ... > Tagged PDF (add document structure) > Export
- Verify that the generated PDF has an Image tag whereas it should be marked as an Artifact or have no tag at all. You can verify tag structure with software of your choice (we are using Adobe Acrobat)

The main issue with PDF exported by LibreOffice is that they don't respect PDF tag standard - such PDFs contain accessibility issues etc.
Comment 7 Christophe Strobbe 2021-08-10 13:52:41 UTC
The capability to mark images as decorative was introduced with Microsoft Word 2019 (it was not present in Word 2016 or earlier versions) and is available in Word 365.

However, the ODF format itself does not contain an element or attribute to mark an image as decorative. The editors of ODF 1.3, published in April 2021, missed the opportunity to add such a feature. (The accessibility subcommittee of the ODF committee at OASIS was closed in 2020.) See the Accessibility appendix in ODF 1.3 and the links that point into the document from there: https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__440376_826425813

This leads to the question whether LibreOffice can (and should) add support for a DOCX feature that has no matching equivalent in the OpenDocument Format.
Comment 8 Michael Stahl (allotropia) 2022-11-16 17:41:56 UTC
(In reply to Christophe Strobbe from comment #7)
> This leads to the question whether LibreOffice can (and should) add support
> for a DOCX feature that has no matching equivalent in the OpenDocument
> Format.

https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes/List_of_LibreOffice_ODF_Extensions#LibreOffice_ODF_extensions

as long as mediawiki can handle the size of the table we can add more :D
Comment 9 Commit Notification 2022-12-09 16:04:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/31084ebb59093be7dfe5ab53a20fdb3bcfde34b6

tdf#143311 offapi,oox,writerfilter,xmloff,sw: decorative flag on flys

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Michael Stahl (allotropia) 2022-12-09 17:26:27 UTC
implemented now on master.
this won't be backported to 7.4 because of the UI change.
Comment 11 Commit Notification 2022-12-12 10:03:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/22cb755ca9ef95cae38bce236f655f0807824d66

tdf#143311 offapi,oox,writerfilter,xmloff,sw: decorative flag on flys

It will be available in 7.5.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Gabor Kelemen (allotropia) 2022-12-12 11:59:23 UTC
Verified in 

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9b46020c262045aed0beace4708565235c2523cc
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Now there is a Decorative checkbox for the image properties, its value is correctly roundtripped to DOCX and ODT format, and when exporting to PDF the PAC tool no longer complains about "Possibly inappropriate use of a "Figure" structure element" and "Alternative text missing for "Figure" structure element" like before this patch.
Comment 13 Commit Notification 2023-02-28 19:43:54 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d4355f14d1483a57fa08579b143a762f0aad4631

tdf#143311 writerfilter: import decorative flag on as-char flys too

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2023-03-02 09:15:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/cc1c04346861afba69215115c026174f758d7272

tdf#143311 writerfilter: import decorative flag on as-char flys too

It will be available in 7.5.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.