https://bugs.documentfoundation.org/show_bug.cgi?id=152540

            Bug ID: 152540
           Summary: RTF: Invalid scale for linked JPG images
                    (INCLUDEPICTURE command)
           Product: LibreOffice
           Version: 7.4.3.2 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Description:
With Bug 59699, the INCLUDEPICTURE command has been partly fixed, such that RTF
documents with a linked image will generally display the linked image.

However, it seems that only PNG files (such as the one linked in the attachment
of the mentioned bug report) show up correctly, while (all/some?) JPG files are
inserted as a tiny thumbnail only. Comment 14 of the mentioned bug also
indicates this problem, but AFAIK, there has not been a follow-up bug report.

To reproduce, I created a 200x200 pixel sample image and saved it in PNG and
JPG format. I created an RTF file with the following code:

{\rtf1
JPG {\field{\*\fldinst{ INCLUDEPICTURE "C:\\\\Temp\\\\sample.jpg" \\*
MERGEFORMAT \\d}}{\fldrslt}} \par
PNG {\field{\*\fldinst{ INCLUDEPICTURE "C:\\\\Temp\\\\sample.png" \\*
MERGEFORMAT \\d}}{\fldrslt}}
\par }

(Paths must be adjusted upon reproducing). When opening the file in MS Word,
both pictures show up with the same size. When opening with LibreOffice Writer,
the PNG shows up at its normal size, but the JPG is just a small, say 5x5 px,
rectangle. When opening the properties of the JPG file, the size information is
set to 0.04cm, but when clicking on "original size", the actual size of the
image seems to appear and after that the PNG and JPG files are of the same
size. I have also tried saving the raw RTF file quoted above as a LibreOffice
RTF file. This will embed both images and I noticed that the \picscalex and
\picscaley of the JPG is 0, but 100 for the PNG. Maybe this is the origin of
the problem? The embedded picture headers are:

JPG:
\picscalex0\picscaley0\piccropl0\piccropr0\piccropt0\piccropb0\picw200\pich200\picwgoal4050\pichgoal4050\jpegblip

PNG:
\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw200\pich200\picwgoal4049\pichgoal4049\pngblip

Steps to Reproduce:
1. Create sample image and save as PNG and JPG
2. Create RTF file linking both images (see MWE in the description)
3. Open RTF in LibreOffice writer

Actual Results:
PNG is displayed correctly, JPG is shown as very small thumbnail.

Expected Results:
Linked JPG and PNG show the same image with the same size.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.4.3.2 (x64) / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to