From b78383bc8fdf3aa1c58d22ffb10e06c51cef9dce Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 13 Mar 2016 23:14:30 +0000 Subject: [PATCH] fpspreadsheet: Fix size calculation for some embedded jpeg images. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4548 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/fpsimages.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/fpspreadsheet/fpsimages.pas b/components/fpspreadsheet/fpsimages.pas index 48bc03fa5..46f566a68 100644 --- a/components/fpspreadsheet/fpsimages.pas +++ b/components/fpspreadsheet/fpsimages.pas @@ -257,8 +257,8 @@ begin AStream.Position := p + rec.RecSize; end; - if dpiX = -1 then dpiX := 96; - if dpiY = -1 then dpiY := 96; + if (dpiX = -1) or (u = 0) then dpiX := 96; + if (dpiY = -1) or (u = 0) then dpiY := 96; if u = 2 then begin dpiX := dpiX * 2.54; dpiY := dpiY * 2.54;