summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/graphical/JPEGComparator.java
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-09-07 16:59:04 +0000
committerOliver Bolte <obo@openoffice.org>2009-09-07 16:59:04 +0000
commit32d107b947702ca0b7362e9ee5d228a18445996a (patch)
tree0e002196241dd043594a8703dc67898468a9c22e /qadevOOo/runner/graphical/JPEGComparator.java
parent8d19f8eab1d0da0467616760009049305159b7e5 (diff)
CWS-TOOLING: integrate CWS qadev38
2009-08-26 09:09:14 +0200 lla r275394 : #i104497# fix broken unoapi tests 2009-08-25 15:16:34 +0200 lla r275362 : #i102426# OfficePriver fix 2009-08-25 15:14:19 +0200 lla r275361 : #i104496# cleanups
Diffstat (limited to 'qadevOOo/runner/graphical/JPEGComparator.java')
-rw-r--r--qadevOOo/runner/graphical/JPEGComparator.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/qadevOOo/runner/graphical/JPEGComparator.java b/qadevOOo/runner/graphical/JPEGComparator.java
index ca7d72b0963c..126d06e11ffc 100644
--- a/qadevOOo/runner/graphical/JPEGComparator.java
+++ b/qadevOOo/runner/graphical/JPEGComparator.java
@@ -160,10 +160,9 @@ public class JPEGComparator extends EnhancedComplexTestCase
assure("File '" + sJPEGFilename + "' doesn't exists.", aFile.exists(), true);
if (aFile.exists())
{
+ GlobalLogWriter.println("Page: " + i);
checkOnePicture(sJPEGFilename, _sResult, _aParams);
}
-
-
}
}
else
@@ -513,14 +512,20 @@ public class JPEGComparator extends EnhancedComplexTestCase
* between old and new graphics. The font of the new graphics is little bit bigger,
* so the pixel count between old graphics and new graphics is twice the more.
*
+ * @param _sOldGfx path & name to the jpeg file (1)
+ * @param _sNewGfx path & name to the other jpeg file (2)
+ * @param _sDiffGfx path & name to the new difference file which shows the difference between (1) and (2)
+ * @return the count of different pixels
+ * @throws java.io.IOException if file access is not possible
*/
- public int estimateGfx(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
+
+ public static int estimateGfx(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
throws java.io.IOException
{
// new count pixels
- int nNotWhiteCount_OldGraphic = PixelCounter.countNotWhitePixelsFromImage(_sOldGfx);
- int nNotWhiteCount_NewGraphic = PixelCounter.countNotWhitePixelsFromImage(_sNewGfx);
- int nNotBlackCount_DiffGraphic = PixelCounter.countNotBlackPixelsFromImage(_sDiffGfx);
+ final int nNotWhiteCount_OldGraphic = PixelCounter.countNotWhitePixelsFromImage(_sOldGfx);
+ final int nNotWhiteCount_NewGraphic = PixelCounter.countNotWhitePixelsFromImage(_sNewGfx);
+ final int nNotBlackCount_DiffGraphic = PixelCounter.countNotBlackPixelsFromImage(_sDiffGfx);
int nMinNotWhiteCount = Math.min(nNotWhiteCount_NewGraphic, nNotWhiteCount_OldGraphic);
@@ -539,7 +544,7 @@ public class JPEGComparator extends EnhancedComplexTestCase
return nPercent;
}
- public int compareJPEG(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
+ private static int compareJPEG(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
{
String sComposite = "composite";
if (OSHelper.isWindows())
@@ -571,6 +576,15 @@ public class JPEGComparator extends EnhancedComplexTestCase
String sBack = aHandler.getOutputText();
GlobalLogWriter.get().println("'" + sBack + "'");
}
+ else
+ {
+ // creates an extra smaller difference picture
+ File aDiffFile = new File(_sDiffGfx);
+ if (aDiffFile.exists())
+ {
+ JPEGCreator.convertToNearSameFileWithWidth340(_sDiffGfx);
+ }
+ }
return nExitCode;
}
@@ -624,7 +638,7 @@ public class JPEGComparator extends EnhancedComplexTestCase
}
catch(java.lang.NumberFormatException e)
{
- GlobalLogWriter.get().println("Number format exception");
+ GlobalLogWriter.get().println("identify(): Number format exception");
nResult = 0;
}
return nResult;