#1 2019-09-11 09:53:16

kalwados
Member
Registered: 2011-04-18
Posts: 15

JPEG images get distorted

Hello *, hello AB.

I have a strange problem while creating PDF files using SynPDF. The page contains a company logo bitmap, ForceJPEGCompression is set to 85. In the resulting PDF file, the logo bitmap is heavily distored; it looks like over-compression. I've tracked down the problem to the JPEG encoder used in SynGdiPlus.pas. There is a procedure GdipTest() which I used to verify the problem: The input file is converted fine to BMP, GIF and PNG, but fails on JPEG image. (I'll try to attach a sample graphic).

Logo example
https://drive.google.com/open?id=1VI_SI … cGKEGMuX-i

The strange thing is: This happens only on customer's computer, which is Windows 10 Pro V1809. On my computer (also Windows 10 Pro V1809) everything works fine. GdiPlus.dll is loaded from
'C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.17763.719_none_7e506e14762b2a2b\gdiplus.dll'
(I did not specify this path, Windows has some kind of magic for loading this DLL)

The GdiPlus.dll version on customer's computer and on my system are the same: v10.0.17763.678

So my questions are:
- besides GdiPlus.dll, which other modules/libraries are involved when creating JPEG images from SynGdiPlus?
- dre there any known problems with GdiPlus and JPEG images?
- does GdiPlus use any configuration options/parameters/registry?

TIA
Achim

Last edited by kalwados (2019-09-11 09:56:52)

Offline

#2 2019-09-11 10:14:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,682
Website

Re: JPEG images get distorted

I never see such a problem, and as far as I know, there is no hidden GdiPlus tweak...

Are you using the latest version of SynPDF + SynGdiPlus units?

What is the exact error triggered by GdipTest ?

Offline

#3 2019-09-11 11:44:23

kalwados
Member
Registered: 2011-04-18
Posts: 15

Re: JPEG images get distorted

ab wrote:

Are you using the latest version of SynPDF + SynGdiPlus units?

I use V1.18 with my enhanced clipping processing patch (EMR_EXTSELECTCLIPRGN; this patch was first accepted but later removed from SynPDF.pas). My local fork still contains this enhancements because some of the images I need to put into PDF include non-rectangular clipping areas -- but not the failed logo image. Besides of that I use the up-to-date code.

But I think it does not matter: The very same executable on my computer creates good-looking JPEG files, on the customers computer the JPEG is bad. Did you had a look at the example image?

ab wrote:

What is the exact error triggered by GdipTest ?

There is no error message;

GdipTest('logo.jpg');

just completes.

Achim

Offline

#4 2019-09-11 14:41:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,682
Website

Re: JPEG images get distorted

I meant low-level error, to retrieve via the IDE debugger.

Does it mean that the conversion works, but the resulting file is incorrect (as the file you uploaded)?

Offline

#5 2019-09-11 14:55:32

kalwados
Member
Registered: 2011-04-18
Posts: 15

Re: JPEG images get distorted

ab wrote:

I meant low-level error, to retrieve via the IDE debugger.
Does it mean that the conversion works, but the resulting file is incorrect (as the file you uploaded)?

Yes, the resulting file is incorrect.

I don't have access to the customer's computer for debugging, but I will try to establish a VPN connection using TeamViewer and then do Remote debugging. Any experience with this setup?

Offline

Board footer

Powered by FluxBB