Update of /cvsroot/libwpg/libwpg/src/lib
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28827/src/lib
Modified Files:
WPG1Parser.cpp
Log Message:
Since now the resolution matters we are trying to get it right (hopefully)
Index: WPG1Parser.cpp
===================================================================
RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG1Parser.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- WPG1Parser.cpp 7 Sep 2009 09:41:29 -0000 1.61
+++ WPG1Parser.cpp 7 Sep 2009 12:09:32 -0000 1.62
@@ -708,9 +708,9 @@
// Sanity checks
if(hres <= 0)
- hres = 1200;
+ hres = 72;
if(vres <= 0)
- vres = 1200;
+ vres = 72;
if (width < 0)
width = 0;
if (height < 0)
@@ -720,6 +720,7 @@
// Bitmap Type 1 does not specify position
// Assume on the corner (0,0)
+
libwpg::WPGBitmap bitmap(width, height, vres, hres);
::WPXPropertyList propList;
propList.insert("svg:x", 0.0);
@@ -770,9 +771,9 @@
// Sanity checks
if(hres <= 0)
- hres = 1200;
+ hres = 72;
if(vres <= 0)
- vres = 1200;
+ vres = 72;
if (width < 0)
width = 0;
if (height < 0)
@@ -791,10 +792,10 @@
libwpg::WPGBitmap bitmap(width, height, vres, hres);
::WPXPropertyList propList;
- propList.insert("svg:x", (double)xs1/1200.0);
- propList.insert("svg:y", (double)(ys1)/1200.0);
- propList.insert("svg:width", (double)(xs2-xs1)/1200.0);
- propList.insert("svg:height", (double)(ys2-ys1)/1200.0);
+ propList.insert("svg:x", (double)xs1/(double)hres);
+ propList.insert("svg:y", (double)(ys1)/(double)vres);
+ propList.insert("svg:width", (double)(xs2-xs1)/(double)hres);
+ propList.insert("svg:height", (double)(ys2-ys1)/(double)vres);
propList.insert("libwpg:mime-type", "image/bmp");
std::vector<unsigned char> buffer;
|