From f8355221ae62b89a706f2d04b63eda658f3ccfa5 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sat, 13 Feb 2016 16:08:01 +1100 Subject: tdf#85761 vcl: JPEG export does not save PPI values correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JPEG values are currently hardcoded to 96PPI when we export JPEGs. The Graphic class doesn't have an easy way to get the PPI, but this can actually be calculated from the pref size and pref map mode (no idea why it is called "Pref"). Interestingly, you need to get a multiplier to work this out, relative to units of 100th mm. The EPS filter code had a function that does exactly this, but it's entirely based on MapMode units so it was really implemented in the wrong class IMO. I have thus moved it out of PSWriter and into MapMode. This also fixes tdf#65695, which was partially fixed, but had the JPEG PPI hardcoded to 96dpi. Also fixes tdf#97481. Change-Id: Iedb674141dd4e22fcbfb7be357dc777f732aa3aa Reviewed-on: https://gerrit.libreoffice.org/22339 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/vcl/graph.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/vcl/graph.hxx') diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 4ca949130e42..7514f8767016 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -31,6 +31,7 @@ #include #include #include +#include enum GraphicType @@ -163,6 +164,8 @@ public: MapMode GetPrefMapMode() const; void SetPrefMapMode( const MapMode& rPrefMapMode ); + basegfx::B2DSize GetPPI() const; + Size GetSizePixel( const OutputDevice* pRefDevice = nullptr ) const; sal_uLong GetSizeBytes() const; -- cgit