Bug 510662

Summary: Okular stretches images embedded in PDFs
Product: [Applications] okular Reporter: Roke Julian Lockhart Beedell <4wy78uwh>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: minor    
Priority: NOR    
Version First Reported In: 25.08.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
URL: https://discuss.kde.org/t/okular-slightly-stretches-some-pdfs-does-anyone-else-experience-this/31567/5?u=rokejulianlockhart
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A Document That Reproduces The Problem
311 px in firefox-143.0.4
311 px in chromium-141.0.7390.65
303 px in okular-25.08.2

Description Roke Julian Lockhart Beedell 2025-10-15 23:52:25 UTC
# SUMMARY

Okular stretches images embedded in PDFs.

# STEPS TO REPRODUCE

1. Create an HTML file with an embedded JPEG, like https://gitlab.com/RokeJulianLockhart.SKLHAD/SG5N9Q/-/commit/867ce958336f5b05ec5a94b06e3a33e841330a53 demonstrates.

2. Export that as a PDF, via firefox-143.0.4 or chromium-141.0.7390.65.

3. Invoke it in Okular, and FF and Chromium's PDFJSes.

4. Compare the widths of the images (merely observe how Okular renders it).

# OBSERVED RESULT

In Firefox's PDFJS instance, a JPEG embedded in a PDF when printed-to-PDF from a webpage with an embedded `img` renders at 446 px at 100 %. In Okular, the equivalent size is 110 %, where it renders at 450 px.

# EXPECTED RESULT

Both should be the same width. The to-be-attached screenshots shall demonstrate both that the zoom levels are equivalent, and that in Okular, the image is noticeably stretched.

# SOFTWARE/OS VERSIONS

> ~~~
> Name         : okular
> Version      : 25.08.2
> Release      : 1.fc42
> Architecture : x86_64
> Install Date : Tue 14 Oct 2025 12:32:19 BST
> Size         : 7369430
> Signature    : RSA/SHA256, Sat 11 Oct 2025 17:03:24 BST, Key ID c8ac4916105ef944
> Source RPM   : okular-25.08.2-1.fc42.src.rpm
> Build Date   : Sat 11 Oct 2025 03:56:51 BST
> Build Host   : buildhw-x86-12.rdu3.fedoraproject.org
> Packager     : Fedora Project
> Vendor       : Fedora Project
> Bug URL      : https://bugz.fedoraproject.org/okular
> ~~~

# ADDITIONAL INFORMATION

This was originally confirmed at https://discuss.kde.org/t/okular-slightly-stretches-some-pdfs-does-anyone-else-experience-this/31567/5?u=rokejulianlockhart#:~:text=I%20see%20exactly%20446%20px,equivalent%20size%20of%20110%25.
Comment 1 Roke Julian Lockhart Beedell 2025-10-15 23:56:02 UTC
Created attachment 185821 [details]
A Document That Reproduces The Problem

>  The bug was created successfully, but attachment creation failed. Please add your attachment by clicking the "Add an Attachment" link below.

Attached a document that reproduces the problem.
Comment 2 Roke Julian Lockhart Beedell 2025-10-16 00:02:45 UTC
Created attachment 185822 [details]
311 px in firefox-143.0.4

My measurements, and zoom (130 %, not 110) were inaccurate in retrospect, but not least because the difference is actually even greater than before, it doesn't matter.
Comment 3 Roke Julian Lockhart Beedell 2025-10-16 00:03:07 UTC
Created attachment 185823 [details]
311 px in chromium-141.0.7390.65
Comment 4 Roke Julian Lockhart Beedell 2025-10-16 00:03:38 UTC
Created attachment 185824 [details]
303 px in okular-25.08.2