Bug Hunting Session
Bug 54546 - PDF A/1-a export broken: forbidden ICC profile version
Summary: PDF A/1-a export broken: forbidden ICC profile version
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.6.0.0.alpha1
Hardware: x86-64 (AMD64) Linux (All)
: medium critical
Assignee: Fridrich Strba
URL:
Whiteboard: target:3.7.0 target:3.6.2
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-09-05 11:17 UTC by Lionel Elie Mamane
Modified: 2012-09-05 15:47 UTC (History)
8 users (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 Lionel Elie Mamane 2012-09-05 11:17:17 UTC
+++ This bug was initially created as a clone of Bug #39355 +++

On Linux Mint 13 KDE 64 bit and LibreOffice from PPA, version 3.6.0.2 (test by albertozugno@gmail.com), official 3.6.1.1 amd64 .deb binaries, libreoffice-3-6 dev tree (tests by lionel@mamane.lu)

Broken PDF A/1

To reproduce:
* Create a document in Writer
* Click "File" > "Export as PDF..."
* Check "PDF A/1-a" on the first tab
* Click "Export"
* Check conformance with a validator:
  http://www.validatepdfa.com/en/online.htm (email)
  http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx (web form)

E.g. the pdf-tools.com validator says:

 The embedded ICC profile's version is not supported.
 The document does not conform to the requested standard.


Probably with the switch from icc module to liblcms2, we also changed the ICC profile version that is embedded in the PDF. I haven't found an easy / FLOSS way to extract the ICC profile from the PDF, so don't know what version exactly is required.

I checked that PDFs exported in PDF/1-a mode by LibreOffice 3.5 do pass the pdf-tools.com validation.
Comment 1 Fridrich Strba 2012-09-05 11:20:55 UTC
Yes, we changed the sRGB profile version. Before it was 2.1, with liblcms2, it is 4.0. Would be nice to know what the standard says and eventually check whether one can generate sRGB 2.1 using liblcms2. Any chance someone can help me to investigate the PDF standard.
Comment 2 Fridrich Strba 2012-09-05 12:32:34 UTC
I committed to master http://cgit.freedesktop.org/libreoffice/core/commit/?id=24f691867d02e853153a53e49276c2a8c30ea1fe that forces version 2.1 of the profile, the same we had in documents generated by LibreOffice 3.5. I tried to validate the document and yes, it was validating.
@Lionel: could you verify and eventually cherry-pick to 3-6 branch if you are happy with the fix?
Comment 3 Lionel Elie Mamane 2012-09-05 13:06:40 UTC
http://www.pdfa.org/publication/technical-note-tn0002-color-in-pdfa-1/ says:

 ICC profiles include major and minor version numbers which reflect the version
 of the ICC specification to which the profile conforms. According to the PDF ref-
 erence for PDF 1.3 and later versions, only specific major/minor ICC profile ver-
 sions are supported by a particular PDF version. For example, according to the
 PDF 1.4 reference only profiles based on ICC specification ICC.1:1998-09 and
 its addendum ICC.1A:1999-04 (internal profile version 2.2) are supported.
 However, this caused problems for users as profiling software moved to newer
 ICC versions. Since the ICC specification mandates that changes in the minor
 version number must never introduce any incompatible changes, industry ex-
 perts from the PDF/A, PDF/X, and color communities agreed on the following re-
 laxed ICC versioning scheme for PDF:
 ·   PDF 1.4 and below accept ICC major version 2 (any minor version).
 ·   PDF 1.5 and above accept ICC major version 4 or below (any minor version).
 On this basis PDF/A-1 documents can use all version 2.x ICC profiles, regardless
 of the minor version.


According to http://www.color.org/icc_specs2.xalter, Specification ICC.1:2001-04,
the latest 2.x is 2.4. So my understanding is we are allowed to use up to 2.4.
Comment 4 Lionel Elie Mamane 2012-09-05 13:38:37 UTC
I've relaxed to 2.4 in master and committed the change to 2.1 in libreoffice-3-6.

Fix will be available in LibreOffice 3.6.2 and later.
Comment 5 Fridrich Strba 2012-09-05 14:26:00 UTC
(In reply to comment #4)
> I've relaxed to 2.4 in master and committed the change to 2.1 in
> libreoffice-3-6.

I reverted that commit for two reasons: 1) we advertise the 2.1 in the name of the profile and that is the version we have in the previous releases; 2) the liblcms2 author recommends to use 2.1 version if we want liblcms2 generate 2.x profiles. So I somehow prefer to play it safe, especially that this is sRGB profile and having a version 2.1 or 2.4 embedded will not change anything in its capacity.
Comment 6 Fridrich Strba 2012-09-05 14:28:09 UTC
(In reply to comment #4)
> Fix will be available in LibreOffice 3.6.2 and later.

I don't see it in libreoffice-3-6 branch. Did you push?
Comment 7 Lionel Elie Mamane 2012-09-05 15:09:54 UTC
(In reply to comment #5)
> (In reply to comment #4)

>> I've relaxed to 2.4 in master and committed the change to 2.1 in
>> libreoffice-3-6.

> I reverted that commit for two reasons: 1) we advertise the 2.1 in the name of
> the profile; 2) the liblcms2 author recommends to use 2.1 version if we want
> liblcms2 generate 2.x profiles.

OK.
Comment 8 Lionel Elie Mamane 2012-09-05 15:47:52 UTC
(In reply to comment #6)
> (In reply to comment #4)

>> Fix will be available in LibreOffice 3.6.2 and later.

> I don't see it in libreoffice-3-6 branch. Did you push?

Yes: http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-6&id=5a36a0cab0d4d32968404c0d88772e1a6303af00

And I cannot see your revert. Did *you* push?