Bug 68759 - FILESAVE: Looses image flip when saving/loading in pptx format
Summary: FILESAVE: Looses image flip when saving/loading in pptx format
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.6.7.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Paul Trojahn
URL:
Whiteboard: BSA target:6.1.0
Keywords:
: 104209 (view as bug list)
Depends on:
Blocks: Impress-Images
  Show dependency treegraph
 
Reported: 2013-08-30 15:42 UTC by Terry Barnaby
Modified: 2017-12-08 17:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (84.72 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2013-08-30 15:42 UTC, Terry Barnaby
Details
a suite of word2013 tests and accompanying word2013 PDFs (1.26 MB, application/zip)
2016-02-19 13:46 UTC, Justin L
Details
patch to export flip to pptx (2.32 KB, application/zip)
2016-02-24 13:10 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terry Barnaby 2013-08-30 15:42:01 UTC
Created attachment 84919 [details]
Example document

Problem description: 
If you flip an image horizontally (not sure about vertically) this "flip" is lost when saving and loading in pptx file format.

Steps to reproduce:
1. Create a presentation with a slide having an image
2. Flip the image horizontally
3. Save and re-load the presentation in pptx format

Current behavior:
Images flip state is lost.

Expected behavior:

              
Operating System: Fedora
Version: 4.1.1.2 rc
Comment 1 ign_christian 2013-08-30 18:15:30 UTC
I can confirm that behavior (horizontal flip) on LO 3.6.7 (Ubuntu 12.04). 
-> so I set version to 3.6.7 as an earlier version that reproducible

If image flipped vertically it will be placed in the bottom right off the screen after reopening file.
Comment 2 Owen Genat (retired) 2014-07-05 15:02:06 UTC
Problem persists under GNU/Linux running v4.3.0.2 Build ID: 14ed55896fdfcb93ff437b85c4f3e1923d2b1409. Horizontally flipped images appear to be reverted, while vertically flipped images are mispositioned off the slide to the lower right (for an image taking up most of a slide).
Comment 3 QA Administrators 2015-07-18 17:44:52 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2015-09-04 11:51:59 UTC
This issue is still present in

Version: 5.0.1.2
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: es-ES (es_ES)

on Windows 7 (64-bit)
Comment 6 Justin L 2016-02-19 13:46:19 UTC
Created attachment 122799 [details]
a suite of word2013 tests and accompanying word2013 PDFs

Importing flipped images needs to be fixed first as others have noted that the image doesn't import in the proper position if it has been flipped.  Better to have the image appear in the right position.
Comment 7 Justin L 2016-02-24 13:10:13 UTC
Created attachment 122944 [details]
patch to export flip to pptx

The rotate and flip functions don't seem to agree well with each other - rotate spins the image all over the place.  I can't figure out how to fix that so I'm attaching my patch to fix this particular bug and walking away.

I think the key file to look at is svx/source/svdraw/svdotext.cxx TRSetBaseGeometry(). This decomposes() the shape added by oox/source/drawingml/shape.cxx createAndInsert() except that it doesn't decompose it into exactly the same flip/rotation.
Comment 8 Yousuf Philips (jay) (retired) 2016-11-28 20:38:45 UTC
*** Bug 104209 has been marked as a duplicate of this bug. ***
Comment 9 Xisco Faulí 2017-02-06 14:41:28 UTC
@Justin,
There's a patch of yours attached here, should you upload it to gerrit for review instead?
Regards
Comment 10 Justin L 2017-02-06 16:48:45 UTC
(In reply to Justin L from comment #6)
> Importing flipped images needs to be fixed first as others have noted that
> the image doesn't import in the proper position if it has been flipped.
According to the 5.3 daily bibisect, this was fixed on Oct 28, likely from Mike's fix for bug 103473 (backported to 5.2.4).

author Mike Kaganski <mike.kaganski@collabora.com>	2016-10-29 12:31:29
commit 1c708eee636c0cdf3da2ec62849618f3262044bc
tdf#103473: Ensure positive rectangle size
Also remove conversion of both negative scales into rotation,
because it is handled by flip; use strict comparison instead of
approximate float less because it's correct here, and also because
basegfx::fTools::less ultimately uses rtl_math_approxEqual, which
description states: attention approxEqual( value!=0.0, 0.0 ) _never_ yields true.

So, this bug needs to be re-evaluated, and my patch potentially is still a valid response.
Comment 11 Justin L 2017-02-08 14:52:19 UTC
(In reply to Xisco Faulí from comment #9)
> There's a patch of yours attached here, should you upload it to gerrit
That patch no longer seems to work (if it ever did - kinda hard to tell when the import didn't work). Someone who understands images can use that as a starting point and devise a proper fix.
Comment 12 Justin L 2017-10-20 10:48:19 UTC
This bug is not fixed. Tested in LO 6.0alpha1
Comment 13 Commit Notification 2017-12-08 02:39:16 UTC
Paul Trojahn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=baa205c001540b5dbc795cd876e661549d432ac1

tdf#68759 PPTX: Export IsMirrored

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Justin L 2017-12-08 12:36:15 UTC
Nice work!  I verified that all of the items in the test suite round-tripped OK.