Bug 162282 - ReqIF export modifies exported embedded EMF images
Summary: ReqIF export modifies exported embedded EMF images
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords: bisected, regression
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2024-07-31 14:28 UTC by Mike Kaganski
Modified: 2024-08-20 08:20 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
An ODT with an embedded EMF (10.73 KB, application/vnd.oasis.opendocument.text)
2024-07-31 14:28 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-07-31 14:28:37 UTC
Created attachment 195625 [details]
An ODT with an embedded EMF

The attached document has a single embedded EMF (220-byte TestSetArcDirection.emf from https://opengrok.libreoffice.org/xref/core/emfio/qa/cppunit/emf/data/TestSetArcDirection.emf?r=c920881f used in https://opengrok.libreoffice.org/xref/core/emfio/qa/cppunit/emf/EmfImportTest.cxx?r=c920881f#844).

Open it, and run this Basic code:

Sub Test
	Dim args(1) As New com.sun.star.beans.PropertyValue
	args(0).Name  = "FilterName"
	args(0).Value = "HTML (StarWriter)"
	args(1).Name  = "FilterOptions"
	args(1).Value = "xhtmlns=reqif-xhtml"

	target = ThisComponent.URL + ".reqif"
	ThisComponent.storeToUrl(target, args())
End Sub

The result is three files in the same directory, a .reqif, a PNG, and a EMF.

In version 7.5, the resulting EMF was exactly the same as embedded in the ODF package, having 220 bytes size. Since version 7.6 (after commit 166a16594eb4e7e78f3f5b00a1432637d109bf8d), its size is more than 100 KB.
Comment 1 Mike Kaganski 2024-08-01 13:29:08 UTC
https://gerrit.libreoffice.org/c/core/+/171377
Comment 2 Commit Notification 2024-08-01 18:34:50 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7a1a0607501e47ff03b1b66e1189a221d327bad4

tdf#162282: restore correct handling of EMF

It will be available in 25.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.
Comment 3 Commit Notification 2024-08-20 08:20:45 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/c96cf61e00a064343934636212160be2d984e774

tdf#162282: restore correct handling of EMF

It will be available in 24.8.1.

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.