Bug 458722 - Bad rendering of data matrix code in Okular (blurry in some conditions)
Summary: Bad rendering of data matrix code in Okular (blurry in some conditions)
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 22.08.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-05 01:41 UTC by Potomac
Modified: 2022-09-06 04:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
PDF test file for Data Matrix Code (3.28 MB, application/pdf)
2022-09-05 01:41 UTC, Potomac
Details
Comparison between Okular and Xpdf for rendering Data Matrix image. (29.68 KB, image/png)
2022-09-06 02:18 UTC, Potomac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Potomac 2022-09-05 01:41:53 UTC
Created attachment 151820 [details]
PDF test file for Data Matrix Code

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open with Okular a PDF file which contains small Data Matrix Codes (similar to QR Code)

2. If this Data Matrix Code is small then you will notice a bad rendering (blurry rendering), much more noticeable when printing on black and white laser print.
3. Open the same PDF with another PDF reader (Xpdf, firefox PDF reader) : you will notice better rendering, sharp rendering

OBSERVED RESULT
Blurry Data Matrix Codes on screen display and on black and white laser print for small Data Matrix Code

EXPECTED RESULT
The Data Matrix Code should be sharp, like other PDF reader.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch linux
(available in About System)
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
Another way to reproduce the problem : buy PDF stamps on french La Poste website :
https://www.laposte.fr/mon-timbre-en-ligne

These stamps have small Data Matrix code, Okular doesn't manage to display them with accuracy, we can see blurry rendering, both on screen and on laser print.

You can also open the attached file "GS1_DataMatrix_Guideline.pdf" with okular, on page 20 you will notice that the data matrix code is bad rendered (blurry areas)
if you compare with PDF firefox reader or Xpdf the rendering is much better.

Data Matrix code on wikipedia :
https://en.wikipedia.org/wiki/Data_Matrix
Comment 1 Albert Astals Cid 2022-09-05 21:31:49 UTC
Okular doesn't do any PDF rendering.

Please report the issue at https://gitlab.freedesktop.org/poppler/poppler/-/issues/new?issue
Comment 2 Potomac 2022-09-06 01:54:16 UTC
(In reply to Albert Astals Cid from comment #1)
> Okular doesn't do any PDF rendering.
> 
> Please report the issue at
> https://gitlab.freedesktop.org/poppler/poppler/-/issues/new?issue

Not sure if poppler is the culprit, as it is used also by Xpdf, and Xpdf doesn't have problem for rendering data matrix code.
Comment 3 Potomac 2022-09-06 02:16:41 UTC
I created a bug report for poppler :
https://gitlab.freedesktop.org/poppler/poppler/-/issues/1291

But as I said I am not sure if poppler is the root cause, I think Okular may not use correctly poppler (bad parameters when calling poppler API ?)
Comment 4 Potomac 2022-09-06 02:18:30 UTC
Created attachment 151859 [details]
Comparison between Okular and Xpdf for rendering Data Matrix image.

Here is a comparison between Okular and Xpdf for rendering Data Matrix image, we can see that Okular doesn't manage to display correctly the data matrix, it's a little blurry.
Comment 5 Oliver Sander 2022-09-06 04:29:06 UTC
xpdf does not use poppler.  Instead, poppler is a (partial) fork of xpdf. The two codes are similar but not identical.

To convince yourself that poppler is the culprit try to render the file with `pdftoppm`.