Apache OpenOffice (AOO) Bugzilla – Issue 123438
Pasting a cropped raster picture into document open in other software (like MS WORD) gives the uncropped image
Last modified: 2014-04-03 05:31:45 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.
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?
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
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
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.
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).
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...
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...
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...
"alg" committed SVN revision 1531931 into trunk: i123438 Corrected crop for clipboard mitmap data preparations
ALG: Okay, committed, done.
*** Issue 122776 has been marked as a duplicate of this issue. ***
Verified on trunk build rev. 1582712, fixed. ENV: Win7 64 bit professional SP1