Bug Hunting Session
Bug 107874 - Scale small images to fit to margins and keep aspect ratio
Summary: Scale small images to fit to margins and keep aspect ratio
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2017-05-15 18:55 UTC by 1000dead
Modified: 2017-06-06 08:04 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 1000dead 2017-05-15 18:55:04 UTC
Description:
Would it be possible to have a shortcut that when a new image is inserted into a page it can be automatically shrunk/expanded to fit to margin while keeping original aspect ratio?

Currently there is no way to scale images to fit to page margins and keep the same image ratio without manually entering either image size once checked against page size, or manually adjusting image by selection and dragging corners by hand. This is very labour-intensive when adding many images of different sizes to a document.

Thank you

Steps to Reproduce:
1. Insert image, right click properties, crop, manually enter numbers adjusting percentage size.

2. Or, right click image, Left click image to select and then drag corners. This is the slowest way.

Actual Results:  
.

Expected Results:
.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Comment 1 Buovjaga 2017-05-25 12:42:37 UTC
I think is more the job for a macro (or extension). Macro recording can get you started with BASIC. You can also ask for help in http://ask.libreoffice.org/ or some forum.

Closing.
Comment 2 1000dead 2017-06-02 13:37:57 UTC
(In reply to Buovjaga from comment #1)
> I think is more the job for a macro (or extension). Macro recording can get
> you started with BASIC. You can also ask for help in
> http://ask.libreoffice.org/ or some forum.
> 
> Closing.



I disagree. Its a simple expansion of an image to page margin while keeping the aspect ratio. This should not need a macro or extension. Also I have tried to do this manually via the image settings, no matter what combination of settings I use when I right click on an image/properites/Type I can not get the image to keep its aspect ratio, and or alignment. As far as I can tell it can only be done by manually dragging the image corners by the mouse which means doing it by eye, very slow when handling hundreds of images and not particularly accurate. If I can not centre an image and expand it to the margins manually in the settings, then even a macro can not help here.

I have been through many forums and asked the question on a chat channel but no one seems to no the answer.

Thank you Buovjaga
Comment 3 Buovjaga 2017-06-02 13:42:04 UTC
(In reply to 1000dead from comment #2)
> I disagree. Its a simple expansion of an image to page margin while keeping
> the aspect ratio. This should not need a macro or extension.

The point is not how simple it is or what you feel about its importance personally. We have to limit the amount of specialised features in order to not clutter the interface to an overwhelming mess. This is why macros and extensions exist - anyone can create a custom tool for their highly specialised task.

Sure, we can ping the UX team about this so we can settle this in a more public arena.
Comment 4 Heiko Tietze 2017-06-02 15:13:50 UTC
If you say page margins how should it be done in case of two or more columns? Guess you want both options a) page and b) paragraph width. What happens when the image wouldn't fit in height? Crop, limit width, or just overflow?
Comment 5 1000dead 2017-06-03 23:08:02 UTC
(In reply to Heiko Tietze from comment #4)
> If you say page margins how should it be done in case of two or more
> columns? Guess you want both options a) page and b) paragraph width. What
> happens when the image wouldn't fit in height? Crop, limit width, or just
> overflow?


The funny thing is, all of this actually already works for large images when you drop them into the page, be it a single page or with multiple columns, it will automatically constrain images perfectly to fit within the page or margins while keeping the correct aspect ratio. However. its just one way only for some reason, I mean I can not do this the opposite way for small images and expand them to fill the space of page or column.

Thank you Heiko
Comment 6 1000dead 2017-06-03 23:26:53 UTC
(In reply to Buovjaga from comment #3)
> (In reply to 1000dead from comment #2)
> > I disagree. Its a simple expansion of an image to page margin while keeping
> > the aspect ratio. This should not need a macro or extension.
> 
> The point is not how simple it is or what you feel about its importance
> personally. We have to limit the amount of specialised features in order to
> not clutter the interface to an overwhelming mess. This is why macros and
> extensions exist - anyone can create a custom tool for their highly
> specialised task.
> 
> Sure, we can ping the UX team about this so we can settle this in a more
> public arena.



The only thing I am disagreeing with, is referring to wanting to expand and image to page constraints as being "a highly specialised task". It just isn't. I am not disagreeing with whether it is easy or hard to implement or whether there is enough room in the UI to add a command, that's a decision for the developers. I only asked "would it be possible?" if it is not, then I will leave it at that. 

Thank you Buovjaga
Comment 7 Buovjaga 2017-06-04 06:21:45 UTC
Well, the fastest way currently is:
1. Note what the current page width is (A4 is 21 cm)
2. Subtract the left & right margins from the width (21 - 4 = 17)
3. Input the result in the sidebar image properties width field after ticking "Keep ratio"

I'm pretty sure this could be turned into a macro without much trouble.

Now I noticed there is even an extension called PicTool, which allows you to manipulate multiple images at once: https://extensions.libreoffice.org/extensions/change-multiple-images-in-writer-pictool

Would you be content with that solution?
Comment 8 Heiko Tietze 2017-06-04 07:37:25 UTC
(In reply to 1000dead from comment #5)
> The funny thing is, all of this actually already works for large images...

The point is that you don't have an option to change this behavior. At least I'm not aware of it. You enhancement request is relevant for a minority so we would have to keep the current behavior by default, and have to introduce something at tools > options. Plus, it also changes the user workflow from modifying resized large images afterwards to changing image on insertion. 

So I would rather go with an extension that goes over the images and updates according your needs. Such an extension could also handle all the variants I listed above.

Other opinions?
Comment 9 Cor Nouws 2017-06-04 07:58:36 UTC
It might be a special use case for a tiny part of the users. But isn't that how a large part of the zillion great features have grown?
Of course fitting it in the UI so that it doesn't make things more complicated is important.
One could simply consider to set it as enhancement, and in the mean time extensions or home grown macro's help out?
Comment 10 Buovjaga 2017-06-04 08:08:27 UTC
(In reply to Cor Nouws from comment #9)
> It might be a special use case for a tiny part of the users. But isn't that
> how a large part of the zillion great features have grown?
> Of course fitting it in the UI so that it doesn't make things more
> complicated is important.
> One could simply consider to set it as enhancement, and in the mean time
> extensions or home grown macro's help out?

I just don't like that we would be automating a single operation. It should preferably be a general "automate operation x upon insertion of object" -thing.
Comment 11 Yousuf Philips (jay) (retired) 2017-06-05 21:13:58 UTC
I agree with Buovjaga and this think should be closed as it isnt something we'll do internally and its up to the user to create it as a BASIC macro or an extension author to create the feature.
Comment 12 Heiko Tietze 2017-06-06 08:04:14 UTC
Extension exists, no strong opinion for this enhancement... so let's close this ticket. Many thanks for the idea, 1000dead. Hope the proposed solution helps you.