Bug 159912 - FILEOPEN: wrong rotation of 3D object
Summary: FILEOPEN: wrong rotation of 3D object
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:24.8.0
Keywords: bibisected, bisected, implementationError
Depends on: 159515
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-26 15:36 UTC by Xisco Faulí
Modified: 2024-03-30 00:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparsion LibreOffice 24.8 master vs MSO (464.46 KB, image/png)
2024-02-26 15:36 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2024-02-26 15:36:53 UTC
Created attachment 192800 [details]
Comparsion LibreOffice 24.8 master vs MSO

Steps to reproduce:
1. Open attachment 192798 [details] from bug 159911

-> The 3D has wrong rotation. if the image is black&white, that's been reported in bug 159911

Reproduced in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: aa49b95cd1bb2baa357c9aac7e5d046630ffac85
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2024-02-26 15:38:01 UTC
Regression introduced by

author	Regina Henschel <rb.henschel@t-online.de>	2024-01-23 20:18:48 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	2024-02-19 13:57:14 +0100
commit 6e5529d7382558a38e547074e2f674e85e11e66e (patch)
tree 045ebb12a3a438aebedafebb481df23ecca2d5a6
parent 81adba0eeed883b939477259ac53c04459d25a4c (diff)
tdf#70039 convert 3D effects to extrusion

Bisected with: bibisect-linux64-24.8
Comment 2 Regina Henschel 2024-02-27 00:40:37 UTC
Before the patch the image was imported without the 3D-properties. So it is more an implementation error than a regression.

I'm unsure how to fix it. I could fix the import for the 3D-properties, but than it renders transparency wrongly (bug 159515). Or I could exclude images from 3D. Suggestion?
Comment 3 Regina Henschel 2024-02-27 09:39:19 UTC
I'll look at it.
Comment 4 Regina Henschel 2024-02-28 18:43:38 UTC
The document shows two problems:
(1) The workaround to rotate the fill image of the shape on import in case a cropped image is rotated is applied to the extruded shape as well. But an extruded shape does not need this workaround, because the extruded shape automatically rotates its fill together with the shape rotation.
(2) An extruded shape is created although it is an image cropped to shape. Because of bug 159515 the shape should no be extruded. I do not find how to know whether the bitmap has transparency or not, or how to get the mime type of the bitmap. I do not see such information at the point in question in Shape::createAndInsert() method.

Therefore the patch goes this way: It fixes part (1) and for part (2) cropped image and images with 3D effects are excluded from extrusion. I have tried to implement the exclusion so, that it can be easily removed when bug 159515 is fixed. For cropped images we have so nearly the same situation as before commit  6e5529d7382558a38e547074e2f674e85e11e66e .

'Nearly' because the following situation has changed: If an image cropped to shape in PowerPoint is rotated with the 'Rotation' property in the 'Size' tab in PowerPoint, then PowerPoint rotates the image together with the crop shape as default. We have 'Rotate together with shape' not implemented. The import rotates the image itself as workaround. This workaround is now also performed, when the image (respectively the crop shape) is rotated by the z-Rotation in the '3D-Rotation' part in the 'Effects' tab.

When you want to test, whether the fix for (1) works, you need to change the code. Remove the parameter bBlockExtrusion in the call of setExtrusionProperties() in shape.cxx file and comment out the definition of the bBlockExtrusion variable there.

We imperatively need the feature "Rotate fill together with shape", bug 34551 and bug 125897.
The case when a shape has got a bitmap fill and is rotated is not solved by the patch. A part corresponding to the workaround in GraphicProperties::pushToPropMap() method is missing in FillProperties::pushToPropMap().

You can see what I plan to do in https://gerrit.libreoffice.org/c/core/+/164107.
Comment 5 Commit Notification 2024-03-02 09:02:34 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#159912 extruded shapes already rotate background

It will be available in 24.8.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 6 Regina Henschel 2024-03-30 00:31:54 UTC
It should be OK on current master. Xisco, please try it out.