Re: Printing problem (bko 129948)

Angelo Naselli <[email protected]>
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
Alle 01:09, domenica 21 gennaio 2007, Angelo Naselli ha scritto:
> From jpeg it should be possible reading
> units -- one byte: Units for the X and Y densities
> 0 => no units, X and Y specify the pixel aspect ratio
> 1 => X and Y are dots per inch
> 2 => X and Y are dots per cm
> Xdensity -- two bytes
> Ydensity -- two bytes

Attached patch should do that, If you agree
I can commit it (after having changed indentation ;) )

Any help to point me to tiff?
TIA,
	Angelo

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Gwenview-general mailing list
Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/gwenview-general
jpeg_dpi.patch (text/x-diff, 971 B)
Index: jpegformattype.cpp
===================================================================
--- jpegformattype.cpp	(revisione 626036)
+++ jpegformattype.cpp	(copia locale)
@@ -453,6 +453,22 @@
 
 			if(consumer) consumer->end();
 
+      //ANGELO
+      const float INCHESPERMETER = (100. / 2.54);
+      switch (mDecompress.density_unit)
+      {
+        case 0:  // 0 => no units, X and Y specify the pixel aspect ratio
+          break;
+        case 1:  //  1 => X and Y are dots per inch
+          image.setDotsPerMeterX(mDecompress.X_density * INCHESPERMETER);
+          image.setDotsPerMeterY(mDecompress.Y_density * INCHESPERMETER);
+          break;
+        case 2:  //  2 => X and Y are dots per cm
+          image.setDotsPerMeterX(mDecompress.X_density * 100);
+          image.setDotsPerMeterY(mDecompress.Y_density * 100);
+          break;
+      }
+      //ANGELO
 			mSourceManager.at_eof = true;
 
 			(void) jpeg_finish_decompress(&mDecompress);
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFs+wVqEs9DA4DquARAqjxAJ0Z3Y85CcDgbbtB8AWmPjF2YKWhWACfZI6V
1Wc/15mkIWtPyM/HLQX0ld0=
=ofha
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.