Bug 156414 - Image inserted in Calc with wrong aspect ratio
Summary: Image inserted in Calc with wrong aspect ratio
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: Calc-Images
  Show dependency treegraph
 
Reported: 2023-07-21 15:13 UTC by Stéphane Guillou (stragu)
Modified: 2024-05-20 10:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample 200×200 px wikipedia logo PNG (37.79 KB, image/png)
2023-07-21 15:13 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Guillou (stragu) 2023-07-21 15:13:45 UTC
Created attachment 188512 [details]
sample 200×200 px wikipedia logo PNG

Steps to reproduce:

1. Open Calc
2. Insert square 200×200 px PNG attachment
3. context menu > Position and Size

Result:
Image size is 5.51 × 5.31 cm (not square).
In Draw, Impress and Writer, the size is 5.29 × 5.29 cm.

Repro in recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Already wrong aspect ratio in OOo 3.3, so inherited.
Comment 1 Stéphane Guillou (stragu) 2023-07-21 15:19:53 UTC
Same on macOS with LO 7.5.4.
Comment 2 Julien Nabet 2023-07-21 17:17:24 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 Rainer Bielefeld Retired 2023-07-22 11:33:57 UTC
REPRODUCIBLE with Server Installation of Version: 7.6.0.0.alpha0+ (X86_64) 
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: Locale: de-DE (de_DE); UI: de-DE; Theme: Automatic (Colibre)
Calc: CL threaded – Special new User Profile for testing

And:
a) not limited to PNG, also observed with JPG and GIF from Wikipedia logo
b) Not limited to import, also observed with copy / paste from DRAW
  (Paste as Bitmap, ...), but there also other effects might interfere
Comment 4 Stéphane Guillou (stragu) 2024-05-15 14:15:51 UTC
Reproduced in recent trunk build:

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 658a212585c56540a17c41111e6829716d4ef4e3
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Using right-click > Original Size restores the correct size.

Hossein, could this be some kind of easyHack, given that "Original Size" is aware of the correct size?
Comment 5 Hossein 2024-05-20 10:52:00 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Reproduced in recent trunk build:
> 
> Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
> Build ID: 658a212585c56540a17c41111e6829716d4ef4e3
> CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: CL threaded
> 
> Using right-click > Original Size restores the correct size.
> 
> Hossein, could this be some kind of easyHack, given that "Original Size" is
> aware of the correct size?
I don't think so, as it may be not be a good decision to reset the image dimensions to their original size after every import or paste.