Bug 40259 - Unexpected behaviour with Shapes → Intersect
Summary: Unexpected behaviour with Shapes → Intersect
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 64770 129230 (view as bug list)
Depends on:
Blocks: Shapes
  Show dependency treegraph
 
Reported: 2011-08-20 15:24 UTC by RGB
Modified: 2023-12-12 21:48 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Examples for Shapes → intersect behaviour (70.34 KB, application/vnd.oasis.opendocument.graphics)
2011-08-20 15:24 UTC, RGB
Details
"Before and after" example (205.94 KB, application/pdf)
2011-08-21 09:30 UTC, RGB
Details
Test of all form functions in LOO 5.3.6.1 64bit win10 (66.37 KB, application/vnd.oasis.opendocument.graphics)
2017-11-19 15:53 UTC, paulystefan
Details
pdf of test of all form functions in 5.3.6.1 64bit win10 (65.17 KB, application/pdf)
2017-11-19 15:55 UTC, paulystefan
Details
test like in Version 5.3.6 with 6.3.0.4 (65.22 KB, application/pdf)
2019-08-23 18:27 UTC, paulystefan
Details
Crop to shape outline (1.54 MB, application/vnd.oasis.opendocument.graphics)
2023-01-14 17:52 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2011-08-20 15:24:25 UTC
Created attachment 50412 [details]
Examples for Shapes → intersect behaviour

Suppose you introduce a picture on a Draw document and then draw on top of it a shape (a rectangle, an ellipse), if you select both and do Right click → Shapes → Intersect you will obtain the shape with the image as background. 

The expected result is the shape showing as background the part of the image that it covered previously to the intersection. While this expectation is fulfilled under certain circumstances (mainly, pictures that were not resized and are smaller than the page) you'll obtain weird results on other situations, like compressed, displaced or even distorted images.

See attached odg for a more detailed explanation and for a simple example to test the behaviour.

NOTE: while reported against 3.4.2, the problem is also present on 3.3.3.
Comment 1 Jeffrey 2011-08-20 18:11:39 UTC
Currently, I cannot seem to find any problems with the intersect tool other than occasionally, the re-sized shape is displaced.

On your attachment, I ran intersect on the two shapes in each section (the image window and the ellipse) and I see no deformation. Am I testing correctly?

On LibreOffice 3.4  340m1(Build:103) for OpenSuse Linux.
Comment 2 RGB 2011-08-21 09:30:38 UTC
Created attachment 50428 [details]
"Before and after" example

On the attached pdf, first page shows the "before and after" for the second image on previous example, while second page shows the "before and after" for the third image.
As you can see from the screen shots, the result on the first page is as if the image had not been rescaled at all. The result on the second image is even worse: the resulting image is not only far smaller than the original image, but it is also horizontally compressed (OK, just a bit, but noticeable).
Comment 3 Björn Michaelsen 2011-12-23 12:34:03 UTC Comment hidden (obsolete)
Comment 4 RGB 2011-12-23 17:04:00 UTC
The problem is present on 3.5 beta2.
Comment 5 Jorendc 2014-06-24 15:11:08 UTC
Still reproducible using Mac OSX 10.9 with LibreOffice Version: 4.3.0.1
Build ID: 9ed0c4329cf13f882dab0ee8b9ecd7b05e4aafbb
Comment 6 vvort 2014-09-18 07:31:55 UTC
*** Bug 64770 has been marked as a duplicate of this bug. ***
Comment 7 Cor Nouws 2014-09-18 08:05:39 UTC
this must be behaviour as it has always been.
Recently in https://bugs.freedesktop.org/show_bug.cgi?id=68236#c6 Regina gave some nice explanation on a 'similar' issue
Comment 8 Cor Nouws 2014-09-18 08:06:28 UTC
managing expectations > importance to medium..
Comment 9 QA Administrators 2015-10-14 19:57:06 UTC Comment hidden (obsolete)
Comment 10 Buovjaga 2015-12-04 16:44:52 UTC
Still repro.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: 81fa5340191baf8687f9c82f1f414f5afc86b529
Threads 4; Ver: Windows 6.1; Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-03_21:19:19
Locale: fi-FI (fi_FI)
Comment 11 QA Administrators 2017-01-03 19:41:28 UTC Comment hidden (obsolete)
Comment 12 RGB 2017-01-03 21:24:51 UTC
Still present on LibO 5.2.3.3 under openSUSE 42.2 (64 bits) system
Comment 13 paulystefan 2017-11-19 15:53:39 UTC
Created attachment 137857 [details]
Test of all form functions in LOO 5.3.6.1 64bit win10

test of all form function in LOO 5.3.6.1 64bit win10

right mouse taste form functions

1st form function: combine is like substract, but i expect add in boolean thinking
2nd form function: connect is weird 
3rd form function: fusion : no effect, what boolean effect is expected here?
4th form function: substract: ok
5th form function: intersect: is weird in all 3 examples in size
6th form function: same width: ok
7th form function: same heigth: ok

Boolean symbols would be nice for boolean form functions.
Comment 14 paulystefan 2017-11-19 15:55:46 UTC
Created attachment 137859 [details]
pdf of test of all form functions in 5.3.6.1 64bit win10

test of all form function in LOO 5.3.6.1 64bit win10

right mouse taste form functions

1st form function: combine is like substract, but i expect add in boolean thinking
2nd form function: connect is weird 
3rd form function: fusion : no effect, what boolean effect is expected here?
4th form function: substract: ok
5th form function: intersect: is weird in all 3 examples in size
6th form function: same width: ok
7th form function: same heigth: ok

Boolean symbols in LOO form functions would be nice for boolean form functions.
Comment 15 paulystefan 2017-11-19 16:25:52 UTC
test of all form function in LOO 5.4.2.1 64bit win10

right mouse button form functions

1st form function: combine is like substract, but i expect add in boolean thinking
2nd form function: connect is weird 
3rd form function: fusion : ellipse gone like in 5.3.6.1, what boolean effect is expected here?

4th form function: substract: ok

5th form function: intersect: is weird in all 3 examples in size

6th form function: same width: ok
7th form function: same heigth: ok

Boolean symbols in LOO form functions would be nice for boolean form functions.

same results like 5.3.6.1
Comment 16 paulystefan 2017-11-19 16:27:22 UTC
(In reply to paulystefan from comment #14)
> Created attachment 137859 [details]
> pdf of test of all form functions in 5.3.6.1 64bit win10
> 
> test of all form function in LOO 5.3.6.1 64bit win10
> 
> right mouse taste form functions
> 
> 1st form function: combine is like substract, but i expect add in boolean
> thinking
> 2nd form function: connect is weird 
> 3rd form function: fusion : no effect, what boolean effect is expected here?
> 4th form function: substract: ok
> 5th form function: intersect: is weird in all 3 examples in size
> 6th form function: same width: ok
> 7th form function: same heigth: ok
> 
> Boolean symbols in LOO form functions would be nice for boolean form
> functions.

fusion: ellipse is gone, no effect on background picture
Comment 17 paulystefan 2017-11-19 16:28:32 UTC
(In reply to paulystefan from comment #13)
> Created attachment 137857 [details]
> Test of all form functions in LOO 5.3.6.1 64bit win10
> 
> test of all form function in LOO 5.3.6.1 64bit win10
> 
> right mouse taste form functions
> 
> 1st form function: combine is like substract, but i expect add in boolean
> thinking
> 2nd form function: connect is weird 
> 3rd form function: fusion : no effect, what boolean effect is expected here?
> 4th form function: substract: ok
> 5th form function: intersect: is weird in all 3 examples in size
> 6th form function: same width: ok
> 7th form function: same heigth: ok
> 
> Boolean symbols would be nice for boolean form functions.

3rd function fusion: ellipse is gone, no effect on background picture
Comment 18 paulystefan 2018-06-21 18:53:58 UTC

 Test of all form functions in LOO 6.0.5.1-64bit in win 10-64
 
right mouse taste form functions

no change against 5.3.6 and 5.4.2 before

Boolean: A is the greater rectangle and B is the ellipse
 
 1st form function: combine is here like substract of A-B=  here A with hole of B, but i expect add like A+B in boolean thinking 

 2nd form function: connect (A+B?) is weird 

 3rd function fusion: (A before B?) ellipse is gone, no effect on background picture
 4th form function: substract: A-B, same like first function, ok

 5th form function: intersect: B-A= Part of A with size of B, is weird in all 3 examples in size

 6th form function: same width like ellipse: ok
(with selection ellipse first, width of ellipse same like rectangle: ok)
 7th form function: same heigth like ellipes: ok
(with selection ellipse first, heigth of ellipse same like rectangle: ok)
 
 Boolean symbols would be nice for boolean form functions.

You need more control of selection with more objects.  

What is first or second if you select both with mouse rectangle?
Comment 19 QA Administrators 2019-06-22 02:49:51 UTC Comment hidden (obsolete)
Comment 20 RGB 2019-06-22 16:11:37 UTC
Same behavior on 6.2.4.2: if the picture was resized before the procedure, Shapes → Intersect gives a distorted "background" to the resulting shape.
Comment 21 paulystefan 2019-08-23 18:27:17 UTC
Created attachment 153605 [details]
test like in Version 5.3.6 with 6.3.0.4

some weird things again in 6.3.0.4 win64 windows 10
but some difference in detail of forms to previous test in 5.3.6
Comment 22 Buovjaga 2020-05-01 17:35:59 UTC
*** Bug 129230 has been marked as a duplicate of this bug. ***
Comment 23 LeroyG 2020-12-16 12:25:34 UTC
If any sides of the bitmap exceed the dimensions of the shape, resulting bitmap is shrinked to these shape sides.

If larger (and not necessarily resized), bitmap is shrinked to the shape dimensions.


Version: 6.4.7.2 (x86)
Build ID: 639b8ac485750d5696d7590a72ef1b496725cfb5
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
Locale: es-MX (es_MX); UI-Language: en-US
Calc: threaded
Comment 24 Nick Tredwell 2021-12-07 08:47:41 UTC
This bug still exists a year later than last comment, and over 10 years since first recorded.

It is obvious that the ability to crop an image with a shape is a desirable feature and would improve LibreOffice's usability for the general public.

Using LibreOffice version 6.4.7.2.

On Linux Mint.
Comment 25 x.topher 2023-01-14 14:17:03 UTC
Hi,
This bug of " auto-resizing image while shape intersected" is very problematic for us with children. At school, here in Belgium, the students use libreoffice Draw everyday. Cropping freely an image is often asked.  
I hope the "IMPORTANCE" report of the bug will switch from "normal" to "high" (It's a ten years bug ;-) ).

Libreoffice Draw (Dessin) is a great piece of software easily assimilated by children (8 - 12 years old). So please, fix that :-) Thanks.
Comment 26 Cor Nouws 2023-01-14 16:09:21 UTC
@regina,
With your comment on https://bugs.documentfoundation.org/show_bug.cgi?id=68236&redirected_from=fdo#c6, I assume changing/fixing this behavior is not at all an 'easy hack'?
Comment 27 Regina Henschel 2023-01-14 17:52:15 UTC
Created attachment 184663 [details]
Crop to shape outline

(In reply to Cor Nouws from comment #26)
> @regina,
> With your comment on
> https://bugs.documentfoundation.org/show_bug.
> cgi?id=68236&redirected_from=fdo#c6, I assume changing/fixing this behavior
> is not at all an 'easy hack'?

It is not an 'easy hack'. And it has not to be done as a 'fix' of the intersection tool.
It could be done with existing features, see attached file. What I have done manually could be done automatically. An additional dialog would be nice to allow the user to adjust the values with having a nice preview. The preview in the Area dialog is not suitable and the current Area dialog has no option to force the original size of the image.

The two clouds in the attached file have the image as area fill, which is inserted in the first slide.
Comment 28 x.topher 2023-01-29 17:32:21 UTC
Hi,
This old bug make the intersect totaly tool unusable with a picture. In my school, a lot of students need that feature to crop freely a picture with this tool everydays.
A solution would be to send this bug directly to the developpers team ;-)
Or a workaround is to use the substract tool several times to remove the unwanted parts of a photo (but it’s not a smart time saver solution). Substract tool works correctly.
Regards.
Comment 29 Regina Henschel 2023-01-29 22:57:12 UTC
(In reply to x.topher from comment #28)
> Hi,
> This old bug make the intersect totaly tool unusable with a picture. In my
> school, a lot of students need that feature to crop freely a picture with
> this tool everydays.

For cropping LibreOffice provides the cropping tool for pictures. Cropping can be done interactively with handles or by the cropping dialog. Only when you will restrict the picture to an outline of an ellipse or a heart for example, you need to know how to use the settings in the area dialog. And I doubt that such outline is a everydays task.

> A solution would be to send this bug directly to the developpers team ;-)

Development of LibreOffice does not work that way. To get something fixed or to get a new feature you could:
Hire a company to develop this and pay for it.
Find a developer to do this for free in his/her spare time.
Propose it as a project for a TDF tender. However, you must be able to estimate the time required and name someone as a contact person who will work with TDF to develop the RFP.
Comment 30 Dayana James 2023-12-12 20:25:45 UTC
Not able to reproduce the problem.The shapes were disappeared while clicking Intersect and the picture remains unchanged.
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
CPU threads: 4; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 31 RGB 2023-12-12 21:48:22 UTC
(In reply to Dayana James from comment #30)
> Not able to reproduce the problem.The shapes were disappeared while clicking
> Intersect and the picture remains unchanged.
> Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
> Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
> CPU threads: 4; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL:
> win
> Locale: en-US (en_US); UI: en-US
> Calc: CL threaded

I can easily reproduce the problem with 

Version: 24.2.0.0.beta1 (X86_64) / LibreOffice Community
Build ID: 5f390384195b7264c6e52add9e90a39790285249
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: it-IT
Calc: threaded

Remember that the problem only appears when the picture has been resized before the intersect process. For example, insert a picture that's bigger than the page so it gets automatically reduced to fit in the margins, then intersect it with a shape: the resulting picture is scaled, not just cropped.