Apache OpenOffice (AOO) Bugzilla – Issue 125300
cropping + scaling image in writer results in a blue rectangle
Last modified: 2017-05-20 10:35:25 UTC
Created attachment 83725 [details] example of the problem open attachment, file->print and in the preview (and output) the scaled + cropped image is just a blue rectangle
The embedded image is SVM, a StarViewMetafile. Extracting it and creating an example file shows print well. Using crop/original size button changes scale from 106%/126% to 100%/100% (image size does not change?) and makes print wor as expected -> has to do somehow with crop scaling
Also happens in AOO410, does not happen in AOO401. The blue is the background fill of the graphic, Area is set to 'Color'. I could only reproduce - with the original graphic - with setting crop to Left=2 and Top=4 (does not happen when setting only one) - Area to color (any) to make visible The other way around: Could avoid error with orig doc by either deleting Left=2 or Top=4. Same happens in Draw/Impress when inserting orig graphic and setting both crop values. Also only goes wrong when setting both. Strange...
Problem happens in the print/PDF preparation when a metafile is prepared (primitive stuff is okay). The metafile is clipped and the cropped part also gets clipped. When these clip PolyPolygons are processed by the MetaFileProcessor (and thus in logic coordinates) an already set VCL ClipRegion collides with a 2nd VCL ClipRegion. To do this, these are clipped against each other to AND them (basegfx::tools::clipPolyPolygonOnPolyPolygon). In this special case the numerical nifties of double precision lead to an empty result. The same works on pixel targets due to a different clipping mechanism. It would be wrong to render the content when the result of clipping is empty; this may be a valid result under various situations. But it is possible to check both PolyPolygons being ranges (rectangles) and simplify execution. This is anyways faster than the clipping and the default case. Adding code to do this and checking...
Okay, my changes do what they should do, preparing commit...
"alg" committed SVN revision 1612866 into trunk: 125300 enhanced handling of multiple ClipRegions in MetafileProcessor
Fixed and asking for release blocker - it's a safe change.
grant showstopper flag
"alg" committed SVN revision 1613069 into branches/AOO410: i125300 enhanced handling of multiple ClipRegions in MetafileProcessor
Okay, added to AOO410 branch, checked, works, committed. Changed target milestone.
Verified AOO411m4(Build:9774) - Rev. 1614049 2014-07-28 17:55 - Linux x86_64
Marking it as verified fixed based on jolatt's verification in comment 10
Decided that the better place to do this is in the basic clipping, moved code to basegfx (see issue 125349)