Bug 34423 - Functionality Request: Rotate Images in Writer
Summary: Functionality Request: Rotate Images in Writer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Tomaz Vajngerl
QA Contact:
URL:
Whiteboard: VOTE target:4.1.0 target:4.2.0
Keywords:
: 46164 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-17 22:34 UTC by sasha.libreoffice
Modified: 2015-07-15 01:15 UTC (History)
20 users (show)

See Also:


Attachments
Sample document (35.56 KB, application/vnd.oasis.opendocument.text)
2011-03-23 21:43 UTC, Rainer Bielefeld Retired
Details
OpenOffice Toolbox (347.33 KB, application/vnd.openofficeorg.extension)
2011-04-29 04:18 UTC, Bernhard Krabina
Details
Documentation and License of the Toolbox (in German) (977.52 KB, application/pdf)
2011-04-29 04:20 UTC, Bernhard Krabina
Details
Test of pasting screenshot on Win8 (85.91 KB, image/png)
2013-05-14 09:01 UTC, Jarl Arntzen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sasha.libreoffice 2011-02-17 22:34:27 UTC
Often I crate documents and insert images from scanner. Images appear some normal and some rotated on 90 degree. For experienced users it is no problem, they have Gimp, but for beginners it is problem. Besides it slows down work when need many images to rotate.

Please, add ability to rotate raster images on 90 degree clockwise an counter-clockwise
Comment 1 Samuel Mehrbrodt (CIB) 2011-03-03 23:44:29 UTC
It's a shame that Writer doesn't support rotating of images (Impress and Draw do).
I hope this will get fixed soon. Any plans on this?
It would be even better to have the image updated live, not only after hitting "OK" and closing the dialog.
Comment 2 Rainer Bielefeld Retired 2011-03-23 21:43:46 UTC
Created attachment 44774 [details]
Sample document

Illustration of the problem and an idea for a workaround or solution
Comment 3 sasha.libreoffice 2011-03-23 23:54:09 UTC
Thanks for explanation. It is very interesting.
When I rotated most bottom of image of this example to 25 degree, it begin to jump on screen.
produced on Libreoffice 3.3.2 on Mandriva 64 bit and windows XP 32 bit
Comment 4 Bernhard Krabina 2011-04-29 04:18:01 UTC
Created attachment 46148 [details]
OpenOffice Toolbox

OpenOffice Toolbox by Thomas Krumbein
Comment 5 Bernhard Krabina 2011-04-29 04:20:31 UTC
Created attachment 46149 [details]
Documentation and License of the Toolbox (in German)
Comment 6 Bernhard Krabina 2011-04-29 04:22:53 UTC
The OpenOffice Toolbox by Thomas Krumbein can do it. It is a set of very useful macros. It works in LibO, but in my test the place of the image changed.

Maybe this functionality (among other functions such as cropping images) should be incorporated in LibO?
Comment 7 Rainer Bielefeld Retired 2011-05-10 00:46:51 UTC
May be you want to vote on our new Voting Page?
<http://wiki.documentfoundation.org/Vote_for_Enhancement>
Comment 8 Dmitry 2011-09-25 11:45:00 UTC
This is basic functional. Must have. Unpleasantly surprised.
Comment 9 Jared 2011-12-22 09:49:45 UTC
Would also love to see this, as in Draw's ability to rotate shapes and photos.
Comment 10 Björn Michaelsen 2011-12-23 11:51:54 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 11 sasha.libreoffice 2011-12-28 03:10:18 UTC
remains in LibO 3.5.0 beta 1
Comment 12 vitriol 2012-02-16 04:39:54 UTC
*** Bug 46164 has been marked as a duplicate of this bug. ***
Comment 13 clement21.philippe 2012-02-16 06:38:15 UTC
Hello, there is the extension WriterRotateTool contouner for this bug.
Is it possible for hackers to integrate the extension WriterRotationTool as default extension in Writer?
With many thanks, Philippe
Comment 14 chtfn 2012-03-23 00:33:53 UTC
Also affected by this in LO 3.5.1
It is really surprising it hasn't been implemented yet.
Comment 15 Jean-Baptiste Faure 2012-03-23 02:53:32 UTC
(In reply to comment #1)
> It's a shame that Writer doesn't support rotating of images (Impress and Draw
> do).

No. From my point of view it a shame to duplicate functionalities between modules. You can do everything you may want on your images in Draw (or Gimp if you prefer). No need to modify them in Writer. Writer is a text processor, not a drawing software. Please, keep it as light as possible.

Best regards. JBF
Comment 16 gleppert 2012-03-23 04:55:54 UTC
@Jean-Baptiste: Like cropping and resizing also rotating of images is IMHO an absolute core functionality of a word processor.

However, in terms of duplication, you are absolutely right. If possible, Writer should use the same code base for rotating images like Draw and Impress do. Wasn't this the goal of the new Drawing Layer?
Comment 17 sasha.libreoffice 2012-03-23 05:06:14 UTC
> Writer is a text processor, not a drawing software.
You are right. But many people think that paint program is msWord. And now we have many doc and docx files with rotated images. And expect that they will open correctly.
Comment 18 chtfn 2012-03-23 08:52:16 UTC
(In reply to comment #15)
> (In reply to comment #1)
> > It's a shame that Writer doesn't support rotating of images (Impress and Draw
> > do).
> 
> No. From my point of view it a shame to duplicate functionalities between
> modules. You can do everything you may want on your images in Draw (or Gimp if
> you prefer). No need to modify them in Writer. Writer is a text processor, not
> a drawing software. Please, keep it as light as possible.
> 
> Best regards. JBF

Actually, rotating an image is an extremely basic task and should be available in writer. Of course everybody expects to see that implemented when all the following image enhancement options are already available in Writer:
- Invert
- Smooth
- Sharpen
- Remove noise
- Solarisation
- Ageing
- Posterise
- Pop art
- Charcoal sketch
- Relief
- Mosaic
- Greyscale
- Black and white
- Watermark
- Change colours, brightness, contrast, gamma
- Transparency
- Flip horizontally or vertically

And no rotating ?? How can you justify that? I understand if you argue about the necessity to have options like "pop art" or "charcoal sketch" available in writer, but a functionality as basic as rotating is a must have.

Just to give an example: today, I was having a look at my new photos, and rotating them with the F-spot viewer. When I added one of those photos to a document in Writer later on, the image wasn't rotated. As an average user, I don't know why Writer didn't take into account the modifications I already made, and I probably don't want to look into it. The only thing I want is an easy way to rotate it directly in Writer, without having to use another specialised software for such a simple task, interfering with my workflow.

Regards.
Comment 19 Rainer Bielefeld Retired 2012-03-23 09:55:04 UTC
May be for now we should add some hints to the manuals that DRAW offers some extended image editing features?
Comment 20 sasha.libreoffice 2012-03-23 22:48:30 UTC
It is very good idea
Comment 21 Bartosz Kosiorek 2012-03-24 17:01:28 UTC
Link to the WriterRotateTool extension http://extensions.services.openoffice.org/en/project/WriterRotationTool
Comment 22 sasha.libreoffice 2012-03-26 00:40:05 UTC
Thanks for link to extension
Currently it not installs in 3.5.1, writes that version greater than 3.3 not supported. May be manual editing of extension needed.
Comment 23 chtfn 2012-04-18 08:45:07 UTC
I confirm that the OpenOffice extension isn't compatible with LO 3.5.2 either.
Also, there is no equivalent extension in the LO Extensions website.

Are there any plans to implement this in 3.6? I really hope so.
Comment 24 sasha.libreoffice 2012-04-18 08:58:33 UTC
Please, do not change Version field in future.
PS: We can draw rectangle in Writer and set picture as texture. Then rotate rectangle. But picture not rotates with rectangle. In all modules of office.
Comment 25 Cor Nouws 2012-04-18 11:33:29 UTC
(In reply to comment #23)
> I confirm that the OpenOffice extension isn't compatible with LO 3.5.2 either.

Any idea why, or could you try to find out via mail list or forum?
Comment 26 gleppert 2012-06-05 02:15:13 UTC
Apparently, the guys at Apache OpenOffice are working on it. Maybe it is a chance to jointly develop that feature:

https://cwiki.apache.org/confluence/display/OOOUSERS/AOO+4.0+Feature+Planning

Thanks.
Comment 27 gleppert 2012-07-05 23:34:46 UTC
For your information, "Rotate Images in Writer" is the absolute *Number 1* of the TopTen for Enhancement Requests on the Documentfoudation Wiki. Please see:
http://wiki.documentfoundation.org/Vote_for_Enhancement#Top_Ten_of_Requests
Comment 28 Gerry 2012-10-06 23:25:00 UTC
Is it correct that a "sane" implementation of rotating images in Writer depends on the complex rewrite of the drawing layer? 

If this is the case, over at Apache OpenOffice, Armin Le Grand is working on it in child workspace AW080: http://wiki.openoffice.org/wiki/Aw080_documentation
Comment 29 chtfn 2013-01-18 03:10:22 UTC
Changed the importance to "high" as this is still unresolved in 3.6.4.3 and it is still the top issue in "Vote for enhancement" (https://wiki.documentfoundation.org/Vote_for_Enhancement#Bug_34423_-_Rotate_Images_in_Writer)

This is a real problem in places where users want to perform tasks as simple as creating a sign or a pdf document with images. In most businesses this would be seen as a serious flaw.
Comment 30 chtfn 2013-01-18 03:43:46 UTC
It is amazing to see that this issue was reported on the OpenOffice bug tracker in... March 2002. Yes, this has been an issue for more than 10 years.
Here is the bug report:
https://issues.apache.org/ooo/show_bug.cgi?id=3545

As it was stated before, ericb2 at Apache is apparently working on it for AOO 4.0 (expected in April 2013), as you can see at the bottom of this page:
https://cwiki.apache.org/confluence/display/OOOUSERS/AOO+4.0+Release+Planning

I could not find any extension implementing this for LO.
Comment 31 chtfn 2013-01-18 04:18:32 UTC
Actually, I found the extension "WriterRotationTool".
It works as a workaround in LO. You will need to install the version 1.0 (tested on LO 3.6.4.3) from there:
http://extensions.services.openoffice.org/en/node/3620/releases

After restarting LO, you should see a new blue icon in the toolbar. By selecting a picture and clicking this icon, you can now rotate the object as it is considered as a graphic.
Comment 32 Rainer Bielefeld Retired 2013-01-18 05:47:19 UTC
We do not need to integrate a function for what an excellent Extension does exist. Or do you breed herrings in your bathtub because the only other way to get herrings is in a store?

So WONTFIX for now.

But we should invite WriterRotationTool Author Thibault Vataire to publish his Extension also on LibO Extensions Repository.
Comment 33 Gerry 2013-01-18 09:47:19 UTC
Dear Rainer, please reconsider your decision to mark this bug as WONTFIX. In my  humble opinion, this is not acceptable given the history and given the demand for this feature. 

The existence of an extension for a fundamental feature of a word processor (that's how it is perceived on the users' side) does not justify to close this bug. Would you close a bug entry as wontfix, if it was a bug that does not allow to type the character "z" and there was an extension enabling the user to type the character "z"? There is a real reason why this bug is ranked so high on the votes for enhancement wiki. The same bug has 12 CC in this bug report, 15 votes on the ODF-wiki and 211 votes in the Apache OpenOffice tracker!

*My suggestion*: Armin and others extensively pointed it out that this bug is a result of a major drawing layer design issue. It is not a easy hack, but a hard hack. Please mark it as such and please help Armin LeGrand to get the Drawing Layer Aw080 done as fast as possible: http://wiki.openoffice.org/wiki/Aw080_documentation
*In my opinion, this is a very difficult task where the guys at Apache OpenOffice need the help and collaboration of the guys at LibreOffice!*
Comment 34 Rainer Bielefeld Retired 2013-01-18 10:47:53 UTC
@Gerry:
It's not my decision, I simply wrote down a fact. It's too improbable that a developer finds time and enthusiasm to do the chin ups for a lot of work (with the current DRAW design) only because some people would prefer to do writer picture rotating by LibO functions instead of Extension functions.

Something completely different is that it definitively will be useful to improve the DRAW design, I hope for progress there, also because of many other issues. I would really like to know how the LibO future plans for collaboration are, I will ask ESC.
Comment 35 Gerry 2013-01-18 12:52:29 UTC
Dear Rainer, thank you very much for your quick response. I fully understand that currently there is no developer taking care of this. Still, I think it is a valid request and therefore it should be not a RESOLVED-WONTFIX bug. The information that TDF and the LibreOffice developers don't prioritize it should be sufficient. 

Please set it to REOPENED, because WONTFIX also means that no standard search in the bug tracker finds this request, that someone will again open a new bug entry on this matter anyway, and that it is kind of an insult to all the people requesting this enhancement.

I love your idea to talk to ESC with regards to the Aw080 work by Armin at Apache. It is a major rewrite (> 2 years of work) which LO will benefit a lot. In the last paragraph of Armin's wiki entry, he asks for bug fixes and that it must be "tested carefully before aw080 can be reintegrated". Cooperation on this also means that Aw080 could directly be integrated in LO if ready.
Comment 36 khagaroth 2013-01-19 10:16:53 UTC
This is low priority and an enhancement, there is no real reason to wontfix this, it can happily sit here another ten years before someone finally fix it or before the AOO drawing layer rewrite is backported to LO, reopened.
Comment 37 Jarl Arntzen 2013-04-08 14:03:45 UTC
Hi everyone. I need this bug/feature so much that I'm willing to pay 30.00 bucks for it.
This offer is registered at FreedomSponsors.org (http://www.freedomsponsors.org/core/issue/229/functionality-request-rotate-images-in-writer).
Once you solve it (according to the acceptance criteria described there), just create a FreedomSponsors account and mark it as resolved (oh, you'll need a Paypal account too)

I'll then check it out and will gladly pay up!

If anyone else would like to throw in a few bucks to elevate the priority on this issue, you should check out FreedomSponsors!

Thanks
Comment 38 Gerry 2013-04-19 09:59:17 UTC
@Cao Cuong Ngo: Thanks a lot for taking the assignment for rotating images in writer.

Although I am not a programmer, a few hints which might be helpful: 

As far as I understood, a sane implementation of image rotation depends on the drawing layer in Writer. This drawing layer change seems to be not a trivial task, but Armin Le Grand from Apache OpenOffice has been working for a long time on it in child workspace AW080: http://wiki.openoffice.org/wiki/Aw080_documentation

Also, it might make sense to link with the Apache guy who started working on this: Ericb2 "Implement image rotation and some other existing draw features in Writer" Please see https://cwiki.apache.org/confluence/display/OOOUSERS/AOO+4.0+Release+Planning
Comment 39 Tomaz Vajngerl 2013-04-19 12:39:41 UTC
Hi,

I have actually already a working solution for the most common use case - 90 degree image rotation. The rotation is working on the image itself, so it does not need a drawing layer rewrite (AOO guy are working on this so we don't need to duplicate the effort). For jpeg images I use a lossless rotation which does not degrade the image quality, for PNG and GIF I just simple recompress the rotated image. Vector images are more complicated and I have not found a solution yet - maybe at first I will disable rotation for this types of images.  

Additional to this I implemented metadata (Exif) extraction for JPEG - this way I detect the orientation of the image. I have integrated this into the import to automatically rotate the image (if the user wishes so).

I will commit the changes during weekend into master so that others can try it out.

@Cao Cuong Ngo: Can you please explain what kind of solution you had in mind?

Regards, Tomaž
Comment 40 Gerry 2013-04-19 12:57:38 UTC
It is nice to see such a sudden move from several people on this important issue which dates far back to 2002 (or even earlier).

@Tomaz: Is it in principle possible to allow any degree of rotation or does it involve serious additional work? I am asking because I often work with scanned objects (e.g. images, graphs, newspaper articles) which often need only minimal rotation to correct for slightly skewed scanning.
Comment 41 Cao Cuong Ngo 2013-04-19 14:20:23 UTC
Hi Tomaz, 

I'm interested in fixing this but not started yet. It'd great if you already have solution. We'll of course see if AOO does something too.

Regards,
Cuong.
Comment 42 Tomaz Vajngerl 2013-04-19 20:19:03 UTC
(In reply to comment #40)
> @Tomaz: Is it in principle possible to allow any degree of rotation or does
> it involve serious additional work? I am asking because I often work with
> scanned objects (e.g. images, graphs, newspaper articles) which often need
> only minimal rotation to correct for slightly skewed scanning.

Unfortunately it is only possible to do 90° rotations this way. The only thing I can make for you is an easier conversion to a draw object but in my opinion the best thing to do in your case is to adjust the angle in an external tool like GIMP for example. To have such an tool built-in is also a good idea - but not so trivial to make.

Regards, Tomaž
Comment 43 Gerry 2013-04-19 21:56:06 UTC
(In reply to comment #42)
> Unfortunately it is only possible to do 90° rotations this way. The only
> thing I can make for you is an easier conversion to a draw object but in my
> opinion the best thing to do in your case is to adjust the angle in an
> external tool like GIMP for example. To have such an tool built-in is also a
> good idea - but not so trivial to make.

Dear Tomaž,
thanks a lot for the explanation. Indeed, 90° rotations will be the first step which is enough for most use cases. For the skewed-scans-use-case I will continue to use an external tool (Gimp) to do this. The internal work-around to rotate in Draw and cut&paste to Writer usually leads to low quality graphics, unfortunately.
To understand the difficulty of any-degree-rotations better: Is this then the aforementioned limitation in the drawing layer (which the Aw080 child workspace tries to solve) which makes these transformations difficult or is there a completely different problem?
Comment 44 Tomaz Vajngerl 2013-04-23 08:46:55 UTC
Hi,

I have commited the rotation code into master - you can test it in the latest daily build [1]. Currently rotation is located in right-click menu on an image, unde "manage graphic" but this may change in the future. 

[1] http://dev-builds.libreoffice.org/daily/master/


(In reply to comment #43)
> Dear Tomaž,
> thanks a lot for the explanation. Indeed, 90° rotations will be the first
> step which is enough for most use cases. For the skewed-scans-use-case I
> will continue to use an external tool (Gimp) to do this. The internal
> work-around to rotate in Draw and cut&paste to Writer usually leads to low
> quality graphics, unfortunately.
> To understand the difficulty of any-degree-rotations better: Is this then
> the aforementioned limitation in the drawing layer (which the Aw080 child
> workspace tries to solve) which makes these transformations difficult or is
> there a completely different problem?

AFAIK it is not really the drawing layer that is the problem  - rotation is nicely supported in Calc, Impress and Draw. The problem is that Writer is using different code than the others. Someone might hack up Writer with rotation support (which would also not be easy at all) but ideally would be to refactor the code to use the common drawing code all across components. This is something Aw080 tries to solve (among many many other things) and it is not a trivial task to do. 

Regards, Tomaž
Comment 45 sasha.libreoffice 2013-04-23 09:10:22 UTC
@ Tomaz Vajngerl
Thanks for implementing this functionality
Comment 46 Jarl Arntzen 2013-04-23 09:59:32 UTC
I tried this on Win 8 in today's Windows build (
2013-04-23_04.48.50_LibreOfficeDev_4.1.0.0.alpha0_Win_x86.msi ). Basically
the context menu says just: Manage Graphic --> <No selection possible>
Should I give it another day before trying again?
I'll try again on Win 7 when I get back home.

Thanks for implementing, anyway!



On Tue, Apr 23, 2013 at 11:10 AM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 45 <https://bugs.freedesktop.org/show_bug.cgi?id=34423#c45>on bug
> 34423 <https://bugs.freedesktop.org/show_bug.cgi?id=34423> from
> sasha.libreoffice@gmail.com *
>
> @ Tomaz Vajngerl
> Thanks for implementing this functionality
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
Comment 47 Tomaz Vajngerl 2013-04-23 11:22:44 UTC
(In reply to comment #46)
> I tried this on Win 8 in today's Windows build (
> 2013-04-23_04.48.50_LibreOfficeDev_4.1.0.0.alpha0_Win_x86.msi ). Basically
> the context menu says just: Manage Graphic --> <No selection possible>
> Should I give it another day before trying again?
> I'll try again on Win 7 when I get back home.
> 
> Thanks for implementing, anyway!

Hi,

I forgot to mention. Currently only jpg, gif (non animated) and png images are supported. For any other you will see the "Manage Graphic --> <No selection possible>". I wanted to support svg and other vector images but I did not manage to losslessly rotate them yet. If you a jpg, gif or png image that show this behavior then I would like to have this document because it is most likely a bug. 

Regards, Tomaž
Comment 48 Jarl Arntzen 2013-04-23 13:15:04 UTC
I've now tested
master~2013-04-23_04.48.50_LibreOfficeDev_4.1.0.0.alpha0_Win_x86.msi<http://dev-builds.libreoffice.org/daily/master/Win-x86@6/current/master~2013-04-23_04.48.50_LibreOfficeDev_4.1.0.0.alpha0_Win_x86.msi>
on
my Win 7 here and it works beautifully in the following cases:

1. Imported JPG rotates left/right
2. Imported PNG rotates left/right
3. Imported JPG rotates left/right

Now, when I simply paste in a screenshot, the command for rotating the
images is simply not available "Manage Graphic --> <No selection
possible>".
However, after saving the document and then restarting Writer, it's again
possible to select left/right rotation on the pasted images from the
context menu again.

Thanks for the good work so far.

I suggest button icons for left/right rotation ends up in the "Picture"
toolbar, right next to the flip horizontally / flip vertically button
icons. I think there are some nice icons in the Tango icon set.
Furthermore, in the cases where left/right rotation is not supported due to
the file format, I propose you simply gray out the buttons and put some
kind of tooltip which states something like "Rotation is supported for GIF,
JPG and PNG images".

Thanks again!




On Tue, Apr 23, 2013 at 1:22 PM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 47 <https://bugs.freedesktop.org/show_bug.cgi?id=34423#c47>on bug
> 34423 <https://bugs.freedesktop.org/show_bug.cgi?id=34423> from Tomaz
> Vajngerl <quikee@gmail.com> *
>
> (In reply to comment #46 <https://bugs.freedesktop.org/show_bug.cgi?id=34423#c46>)
> > I tried this on Win 8 in today's Windows build (
> > 2013-04-23_04.48.50_LibreOfficeDev_4.1.0.0.alpha0_Win_x86.msi ). Basically
> > the context menu says just: Manage Graphic --> <No selection possible>
> > Should I give it another day before trying again?
> > I'll try again on Win 7 when I get back home.
> >
> > Thanks for implementing, anyway!
>
>
> Hi,
>
> I forgot to mention. Currently only jpg, gif (non animated) and png images are
> supported. For any other you will see the "Manage Graphic --> <No selection
> possible>". I wanted to support svg and other vector images but I did not
> manage to losslessly rotate them yet. If you a jpg, gif or png image that show
> this behavior then I would like to have this document because it is most likely
> a bug.
>
> Regards, Tomaž
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You are on the CC list for the bug.
>
>
Comment 49 Gerry 2013-04-25 06:22:45 UTC
Dear Tomaž, thanks a lot for progamming this enhancement. Looking here [1] and here [2], many people will be thankful for this! 

Can we already mark this bug as RESOLVED->FIXED?

Shall we create two follow-up bug entries? Such as:
* Allow rotation of vector graphics (e.g. SVG) in Writer
and
* Allow rotation of images in Writer in any degrees (currently only 90° steps possible)



[1] https://wiki.documentfoundation.org/Vote_for_Enhancement#Bug_34423_-_Rotate_Images_in_Writer
[2] http://www.freedomsponsors.org/core/issue/229/functionality-request-rotate-images-in-writer
Comment 50 Samuel Mehrbrodt (CIB) 2013-04-25 09:21:24 UTC
Maybe before we close this bug, Tomaz, could you make a few small enhancements to be consistent with the UI:

- Add a menu entry in the "Format" menu named "Rotate Picture"
- Add buttons the the "Picture" toolbar.
- Rename the "Manage Graphic" context menu entry to "Rotate Picture"
- If Rotation is not possible, show a hint, even in the menu.


Thanks for your work :) It's been a long-awaited feature.

@Jarl Arntzen: When commenting via email, please remove the former comment from your mail. Thanks.
Comment 51 Jarl Arntzen 2013-04-25 10:28:08 UTC
@Tomaž Vajngerl: Thanks for your efforts thus far. I really appreciate it!
I'd like to encourage you to register as a programmer at FreedomSponsors.org to get some payment for your work after adding some or all of Samuel's suggestions (below):
http://www.freedomsponsors.org/core/issue/229/functionality-request-rotate-images-in-writer



@Samuel M.: Absolutely. I'll remove the previous message. Just didn't realize how Gmail handles this in the new layout before now.
Comment 52 Commit Notification 2013-05-11 17:18:14 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

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

fdo#34423 Add Rotate Left/Right to toolbar and menubar.



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 53 Jarl Arntzen 2013-05-13 20:20:51 UTC
@Tomaž Vajngerl: Fantastic work! The rotate left/right arrows are very easy to find, right next to the flip buttons.

I've tested image rotation in Win 8 using this build.
----------
master~2013-05-13_01.26.32_LibreOfficeDev_4.1.0.0.alpha1_Win_x86.msi   
Version: 4.1.0.0.alpha1+
Build ID: c0417e82174297ace604c68fc577c831929f357
----------

Works well:
1. Rotating left/right works very well with all 4 anchor types and wrap types.
2. Setting grayscale/black and white/watermark works well without interference.
3. Tweaking colors works without trouble.
4. Transparency works.

Workarounds needed:
1. Pasting an image requires saving and reloading the .odt-file to enable the buttons and allow any rotation.
2. Using any of the graphic filters also instantly disables the rotate-button and the file needs saving and reloading before the buttons are enabled again. 
3. Vertical or horizontal flipping is instantly reset when any of the rotate buttons are pressed. (Minor)

I'll test this more on Linux Mint 14 later...

Thanks again!

Even with these workarounds, I consider the feature complete enough to pay out the reward. Image rotation reward on FreedomSponsors.org has hereby been upped to $40 and paid in full.  
See: http://www.freedomsponsors.org/core/issue/229/functionality-request-rotate-images-in-writer if you consider contributing towards further bugfixing and improvements. 

Kind Regards, 
Jarl Arntzen
Comment 54 Tomaz Vajngerl 2013-05-13 22:11:31 UTC
(In reply to comment #53)
> 1. Pasting an image requires saving and reloading the .odt-file to enable
> the buttons and allow any rotation.
I can not reproduce this in Linux - it works fine if I copy/paste or drag&drop a Jpeg image. What is the type of image? Can you also check in "Compress Graphic.." dialog (in LO 4.1). I will try this tomorrow in Windows - maybe the problem is windows specific. 

> 2. Using any of the graphic filters also instantly disables the
> rotate-button and the file needs saving and reloading before the buttons are
> enabled again. 
When you use a graphic filter the image becomes uncompressed - this is however not a format that is currently supported. When you later save the document, the image is compressed to PNG - this is why it works when you reload. I will add uncompressed and some other image formats in the next step.

> 3. Vertical or horizontal flipping is instantly reset when any of the rotate
> buttons are pressed. (Minor)
Hm.. this one is interesting. I have to see what is going on here. 

One open item is also:
- If Rotation is not possible, show a hint, even in the menu.

I really do not know how to easily do that. Toolbars, menus are hardcoded - it is really hard to show any additional hints. The only way I can think of right now is to leave buttons and menu items enabled but show a dialog when it is not possible but I think this is lame. If anyone knows of an example where such hint is used in LO, then let me know.

> Thanks again!
> 
> Even with these workarounds, I consider the feature complete enough to pay
> out the reward. Image rotation reward on FreedomSponsors.org has hereby been
> upped to $40 and paid in full.  
> See:
> http://www.freedomsponsors.org/core/issue/229/functionality-request-rotate-
> images-in-writer if you consider contributing towards further bugfixing and
> improvements. 

Oh great, thanks.
 
> Kind Regards, 
> Jarl Arntzen

Regards, Tomaž
Comment 55 Jarl Arntzen 2013-05-14 09:01:27 UTC
Created attachment 79287 [details]
Test of pasting screenshot on Win8

This image shows the Compress Image dialog after pasting a screenshot in Win8
Comment 56 Jarl Arntzen 2013-05-14 12:11:43 UTC
> > 1. Pasting an image requires saving and reloading the .odt-file to enable the
> > buttons and allow any rotation.
> I can not reproduce this in Linux - it works fine if I copy/paste or drag&drop a
> Jpeg image. What is the type of image? Can you also check in "Compress
> Graphic.." dialog (in LO 4.1). I will try this tomorrow in Windows - maybe the problem is windows specific.

See attachment above. Like you say, drag-drop or copy/paste of jpg or png files on disk works very well. I wasn't even aware of this option.
A pasted screenshot, however is reported as file type "Unknown" in the Compress Graphic dialog (see attachment). After saving and reloading the writer file, the pasted screenshot is reported as being PNG and can be rotated.
Now, I do not really think this is a big weakness. In my experience, I can not really think of a good reason for rotating a screenshot at all. Cropping, however, is something that happens all the time in my line of work.


> One open item is also:
> > - If Rotation is not possible, show a hint, even in the menu.
> I really do not know how to easily do that. Toolbars, menus are hardcoded - it
> is really hard to show any additional hints. The only way I can think of right
> now is to leave buttons and menu items enabled but show a dialog when it is not
> possible but I think this is lame. If anyone knows of an example where such
> hint is used in LO, then let me know.

Not to worry. Simply disabling the buttons rotation buttons is more than good enough for a hint.
I was thinking of the case where rotation is not possible until the user takes some additional action, like saving and reloading the document.
And in such a case, disabling the rotation buttons would be the correct feedback along with a tooltip on each disabled button which states something like:
"Please save and reload the document to allow rotating the image."
As stated above, this might only occur when a user pastes a screenshot. Also, this issue will be moot if the "uncompressed" format is supported in the future.


> 2. Using any of the graphic filters also instantly disables the
> rotate-button and the file needs saving and reloading before the buttons are
> enabled again.
"When you use a graphic filter the image becomes uncompressed - this is however not a format that is currently supported. When you later save the document, the image is compressed to PNG - this is why it works when you reload. I
will add uncompressed and some other image formats in the next step."

Sounds good. I've almost never used the filters but adding handling of the uncompressed images will also solve the screenshot pasting issue.


>> 3. Vertical or horizontal flipping is instantly reset when any of the rotate
>> buttons are pressed. (Minor)
>Hm.. this one is interesting. I have to see what is going on here.
I can't remember the last time using any of the flip buttons but, of course, flipping may be very useful to many.
Comment 57 Commit Notification 2013-06-03 21:57:11 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

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

fdo#34423 Allow to rotate raw uncompressed bitmaps.



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 58 Commit Notification 2013-06-03 22:23:15 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=01c5c1de3acc9039fabef1fa03d171fa1a75a702&h=libreoffice-4-1

fdo#34423 Allow to rotate raw uncompressed bitmaps.


It will be available in LibreOffice 4.1.

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 59 tommy27 2013-06-13 04:50:32 UTC
great job Tomaz!!!
this fixes a longstanding OOo issue that was opened in 2002, received more than 200 votes but was never resolved by Sun/Oracle/Apache devs.

https://issues.apache.org/ooo/show_bug.cgi?id=3545
Comment 60 Jarl Arntzen 2013-06-14 12:35:00 UTC
Hi. I've just tested this out on Win7 now. The rotation works really well!
Be it screenshots pasted directly into the document, images drag-dropped in from the desktop or imported through Insert -> Picture -> From file... Even a linked image can be rotated. Great work.

Some small bugs:
1. Swapped flip directions
Now, I didn't notice at first but on the toolbar both the horizontal and vertical flip buttons has the tooltip "Flip Horizontally" and each one now does the opposite to what the icon might indicate. The left/right-pointing arrow flips the image up/down and vice versa.

2. Missing icon:
Also, on the context menu, the icon is missing for "Rotate 90 left" but is present for the other option. 

Other than that, it works beautifully. 

Version: 4.2.0.0.alpha0+
Build ID: c36348f20c4fcb6ae1acb0fd06c19edfa9fb108

Thanks!
Comment 61 Tomaz Vajngerl 2013-06-25 21:02:42 UTC
Hi,

(In reply to comment #60)
> Some small bugs:
> 1. Swapped flip directions
> Now, I didn't notice at first but on the toolbar both the horizontal and
> vertical flip buttons has the tooltip "Flip Horizontally" and each one now
> does the opposite to what the icon might indicate. The left/right-pointing
> arrow flips the image up/down and vice versa.

This is not related to image rotation. Can you file a new bug for this? Thanks.  

> 2. Missing icon:
> Also, on the context menu, the icon is missing for "Rotate 90 left" but is
> present for the other option. 

OK, this has been fixed. 

Regards, Tomaž
Comment 62 Gerry 2013-06-26 07:19:34 UTC
Hi Tomaž, thanks for your great work on this. 

I'd like to ask whether rotation of SVGs is now also supported or whether it is planned for the future? Thanks.
Comment 63 Tomaz Vajngerl 2013-06-26 13:42:42 UTC
(In reply to comment #62)
> Hi Tomaž, thanks for your great work on this. 
> 
> I'd like to ask whether rotation of SVGs is now also supported or whether it
> is planned for the future? Thanks.

It is planned but first I have to figure out how to do it. It should in theory be easy to rotate a vector image (svg import -> vector image -> rotate -> svg export) but for some reason this did not work when I tried it.
Comment 64 Ron Johnson 2013-07-25 18:24:10 UTC
Thanks for this feature.  It'll simplify some of my tasks.
Comment 65 Kevin Suo 2013-09-23 09:00:49 UTC
I believe image rotation feature is there since LibreOffice 4.1, so maybe this bug report should be marked as RESOLVED FIXED?
Comment 66 sasha.libreoffice 2013-09-23 10:19:16 UTC
Indeed, in initial description of this bug requested rotation only by 90 degree. Therefore feature is fully implemented. Thanks to  Tomaz Vajngerl.
But bug is assigned to him. And therefore it is up to him to decide when to close.
Comment 67 tommy27 2013-09-23 18:36:33 UTC
(In reply to comment #66)
> Feature is fully implemented. Thanks to  Tomaz Vajngerl.
> But bug is assigned to him. And therefore it is up to him to decide when to
> close.

are you sure this is the rule?
I thought that any user could mark this a RESOLVED FIXED since we all agree that the new feature works perfectly.

anyway thumbs up for Tomaz!!!