This is a followup to bug 104288 When a file with images is saved as RTF, the images are saved twice. 1. Open attachment 126445 [details] from bug 101170 in Writer. It has a single image. 2. Save as RTF. -> file size is roughly twice of the original. See: https://bugs.documentfoundation.org/show_bug.cgi?id=101170#c11 https://bugs.documentfoundation.org/show_bug.cgi?id=82033#c13 grepping the plain text shows what happens: $ grep "\\pict" logo_only\(1\)* logo_only(1).rtf:\plain\fs20\s15\tx7935\fs20\tx7935 \cf0{\*\shppict logo_only(1).rtf:{\pict logo_only(1)-LO242.rtf:{\pict{\*\picprop{\sp{\sn wzDescription}{\sv }}{\sp{\sn wzName}{\sv }}}\picscalex5\picscaley5\piccropl0\piccropr0\piccropt0\piccropb0\picw2944\pich1336\picwgoal44160\pichgoal20040\jpegblip logo_only(1)-LO242.rtf:{\pict{\*\picprop{\sp{\sn wzDescription}{\sv }}{\sp{\sn wzName}{\sv }}}\picscalex5\picscaley5\piccropl0\piccropr0\piccropt0\piccropb0\picw2944\pich1336\picwgoal44160\pichgoal20040\jpegblip two \pict sections instead of one. Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: a09b59cdbde2ab92bbbb6737337b74a7a62b17f1 CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: en-US (hu_HU); UI: en-US Calc: threaded
Created attachment 190669 [details] The original file saved with Writer master
Confirmed with: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 257be962efc57a341617b214303b29bff2022c6a CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win Locale: en-US (C); UI: en-US Calc: CL threaded Second copy of image came because of strange table written into RTF: {\*\pgdsctbl ... }. As I see from sources it stores some page properties into this destination (including header/footer and image in this case). But \pgdsctbl - is not a standard RTF tag and RTF specification 1.9.1 has no info about it. Looks like it is not read even by Writer these days. Looks like it should be safe to remove from export. But I want to investigate a reason for this.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b6a7d8201bdb6c28e18472326b2328507a6b1e4e tdf#158083: RTF: drop export for \pgdsctbl It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/1d16c19c47a5d0c679e88281e08d1548867170a1 tdf#158083: RTF: drop export for \pgdsctbl It will be available in 7.6.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.