Issue 123438 - Pasting a cropped raster picture into document open in other software (like MS WORD) gives the uncropped image
Summary: Pasting a cropped raster picture into document open in other software (like M...
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: editing (show other issues)
Version: 4.0.0
Hardware: PC Windows 7
: P3 Normal (vote)
Target Milestone: 4.1.0
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
: 122776 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-10-07 01:47 UTC by albannach
Modified: 2014-04-03 05:31 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.0.1
Developer Difficulty: ---


Attachments
Sample Source Document (12.94 KB, application/vnd.oasis.opendocument.graphics)
2013-10-07 05:58 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description albannach 2013-10-07 01:47:48 UTC
This problem appeared with Version 4.0.1. The process worked correctly with 4.0.0. When I copy a cropped bitmap, and try to paste into Microsoft Word, what appears is the uncropped image. (It pastes correctly into OOo Writer and Draw.) Even if I save, close, and reopen the Draw document, the cropped image appears, but if I recopy and repaste into Word, the uncropped image appears again. However, if I paste it back into Draw, it appears correctly. I tried a workaround by pasting into Corel Painter 12, then from there into Word, which sort of worked, but the colors got changed – yellow in Draw got changed to magenta in Painter, and so on.
Comment 1 Rainer Bielefeld 2013-10-07 05:48:01 UTC
More or less reproducible with "AOO 4.0.1   – German UI / German locale  [Rev. 1524958 2013-09-20 11:40:29]" on  German WIN7 Home Premium (64bit)", “historic”  4.0  User Profile used for all  predecessor versions  and SoftMaker FreeOffice from <http://www.freeoffice.com/> (I do not have WORD available)

Steps how to reproduce:

0. Launch WORD (or SoftMaker FreeOffice Textmaker) with blank new document
1. Open attached Sample document from AOO Start Center file menu
   > Contains a cropped Wikiquote logo
2. click cropped Wikiquote logo
   control points appear
3. <control+c> for copy
4. Click into Textmaker document 
5. <control+v> for paste
   Expected: cropped picture as in AOO Draw
   Actual: complete picture shown                        :-(

10. Repeat test with sample document opened in AOO 3.4.1 in Step 1
    Picture will be shown cropped in target document     :-)

So it seems that clipboard contents is no longer correctly readable for other software?
Comment 2 Rainer Bielefeld 2013-10-07 05:58:13 UTC
Created attachment 81719 [details]
Sample Source Document

Already Reproducible with:
* server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m2(Build:9701)  -  Rev. 1489073  2013-06-03 13:48:37]" on German WIN7 Home Premium (64bit)", own separate user profile
* server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m1(Build:9700) - Rev. 1482523 Rev.1482259 (2013-05-15)]" on German WIN7 Home Premium (64bit)", own separate user profile. But here pasted picture somewhere between full picture and cropped picture (wrong area shown)

Was still ok with:
* server installation of  "AOO 4.0.0-Dev – English UI / German locale [AOO400m1(Build:9700) - Rev.1476029]" on German WIN7 Home Premium (64bit)", own separate user profile
* server installation of  " AOO 4.0.0-Dev  – English UI / German locale [AOO400m1(Build:9700) - Rev. 1457992 - Rev.1457606]" on German WIN7 Home Premium (64bit)", own separate user profile
Comment 3 Edwin Sharp 2013-10-07 06:12:09 UTC
Copy cropped picture and paste in Word 2007 result in blank rectangle with text:
"The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again."

AOO410m1(Build:9750)  -  Rev. 1525015
Rev.1525015 
Win 7
Comment 4 Rainer Bielefeld 2013-10-07 06:44:10 UTC
Copy/paste to AOO works fine, problem only appears when paste to documents opened in different software. Back to status of comment 2

I modify Version because problem already appeared in AOO 4.0.0-dev

@Edwin
Please do not hijack Bugs for completely unrelated different problems. Here we are talking about cropped pictures shown uncropped when pasted to other software. There might be a relation to your observations, but I doubt.

Please submit a separate Issue for your observations.
Comment 5 Armin Le Grand 2013-10-11 17:19:03 UTC
ALG: Problem seems simply that the original graphic is put to the clipboard. Checking...
(a) self created (insert shape, convert to bitmap, crop) -> works
(b) self created metafile -> works
(c) inserted SVG -> works
(d) inserted metafile -> works
(e) inserted gif -> wrong, full image and offset in it (right-shifted)
(f) inserted jpeg -> correct in word, strange colors in paint.NET
(g) inserted PNG -> wrong, full image appears (word and paint.NET)
Seems to depend on image type; this is absolutely possible, there are shortcut paths for image access throughout the office code. If one of these does not take into account that the image is clipped, it will be used completely. Background: The clippped image is always complete in the model, clipping is defined by 4 values (in image coordinate units) which define the crop distances from all four edges.
Thus, AFAICS, wrong for gif and PNG (paint.NET has a strange clipboard implementation, not sure if the wrong colors can be taken as a hint for another error).
Comment 6 Armin Le Grand 2013-10-14 14:08:49 UTC
ALG: Found a problem in GraphicObject::GetTransformedGraphic when the graphic is pixel and defined in 1/100th mm; in this case the conversion needs an exceptioal path, as already done for metafile. Unifying this, trying out...
Comment 7 Armin Le Grand 2013-10-14 14:42:12 UTC
ALG: Uinfication of crop calculationin GraphicObject::GetTransformedGraphic did not work; metafile mode needs logic units in image coordinates, pixel data needs pixels (to really crop the image). Changed, also adapted scaling error when real image size and logic image size do not correlate. Checking...
Comment 8 Armin Le Grand 2013-10-14 14:58:58 UTC
ALG: Checks for broken cases:

gif: works as expected, still right-shifted in Paint.NET, but okay in all others, thus probably a problem there
PNG: Okay, works as expected

Checks for the others (just to be sure):

jpeg: Works same (still strange colors in paint.NET)
metafile: okay
SVG: Okay
self-created bitmap: Okay
self-created metafile: Okay

preparing checkin...
Comment 9 SVN Robot 2013-10-14 15:01:01 UTC
"alg" committed SVN revision 1531931 into trunk:
i123438 Corrected crop for clipboard mitmap data preparations
Comment 10 Armin Le Grand 2013-10-14 16:28:34 UTC
ALG: Okay, committed, done.
Comment 11 Armin Le Grand 2013-11-19 14:39:48 UTC
*** Issue 122776 has been marked as a duplicate of this issue. ***
Comment 12 Clarence GUO 2014-04-03 05:31:33 UTC
Verified on trunk build rev. 1582712, fixed.
ENV: Win7 64 bit professional SP1