Apache OpenOffice (AOO) Bugzilla – Issue 121858
GraphicProvider: document its capability to scale, crop and change the image resolution
Last modified: 2013-03-06 14:36:16 UTC
When you store a css::graphic::XGraphic using the css::graphic::GraphicProvider service, you can set some filter settings in the "FilterData" passed among the css::graphic::MediaProperties to css::graphic::XGraphicProvider::storeGraphic(). Before passing the graphic to the GraphicFilter, among with the FilterData, the GraphicProvider performs some interesting task like cropping, scaling, and changing the image resolution, depending on some extra properties set on the FilterData: - cropping: "GraphicCropLogic" - css::text::GraphicCrop "RemoveCropArea" - boolean - scaling: "PixelWidth" - long "PixelHeight" - long - resolution "LogicalSize" - css::awt::Size "ImageResolution" - long As documented in ImplApplyFilterData: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/graphic/provider.cxx?revision=1431512&view=markup#l596 this method applies following attributes to the graphic, in the first step the cropping area (logical size in 100thmm) is applied, in the second step the resolution is applied, in the third step the graphic is scaled to the corresponding pixelsize. if a parameter value is zero or not available the corresponding step will be skipped This should be document somewhere, may be in http://www.openoffice.org/api/docs/common/ref/com/sun/star/graphic/XGraphicProvider.html#storeGraphic or http://www.openoffice.org/api/docs/common/ref/com/sun/star/graphic/MediaProperties.html#FilterData
This seems to be internally available since 2007, while fixing bug 72365 and bug 76451 : http://hg.services.openoffice.org/OOO340/rev/a3e6dfb33340 author obo Tue Jan 23 08:55:14 2007 +0000 (2007-01-23) changeset 185172 a3e6dfb33340 parent 185171 fe3a14004e23 child 185173 9d530b41ba39 INTEGRATION: CWS impress115 (1.9.18); FILE MERGED 2007/01/16 11:10:13 sj 1.9.18.2: #i72365# storeGraphic of the GraphicProvider is now able to resize the Graphic as it is also possible with the GraphicExporter (now without changing the original graphic) 2006/12/07 15:54:14 sj 1.9.18.1: #i72365# storeGraphic of the GraphicProvider is now able to resize the Graphic as it is also possible with the GraphicExporter http://hg.services.openoffice.org/OOO340/rev/d84c7119acc9 author kz Thu May 10 09:14:35 2007 +0000 (2007-05-10) changeset 192004 d84c7119acc9 parent 192003 80d88acba4e5 child 192005 4c9ada99bd4a INTEGRATION: CWS impress120_SRC680 (1.9.26.1.4); FILE MERGED 2007/04/17 15:06:35 sj 1.9.26.1.4.1: #i76451# fixed stream seeking problem when storing certain kind of graphics (vclmetfile, wmf..)