Package org.mapfish.print.test.util

Examples of org.mapfish.print.test.util.ImageSimilarity


                        File file = new File(expectedOutputDir, "image-similarity.txt");
                        if (file.isFile()) {
                            String similarityString = Files.toString(file, Constants.DEFAULT_CHARSET);
                            similarity = Integer.parseInt(similarityString.trim());
                        }
                        new ImageSimilarity(image, 50).assertSimilarity(expectedOutput, similarity);
                    }
                } catch (Throwable e) {
                    errors.put(example.getName() + " (" + requestFile.getName() + ")", e);
                }
            }
View Full Code Here


        final BufferedImage referenceImage = ImageSimilarity.mergeImages(layerGraphics, 2625, 1225);

//        ImageIO.write(referenceImage, "png", new File("e:/tmp/expectedSimpleImage.png"));

        new ImageSimilarity(referenceImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.png"), 20);

    }
View Full Code Here

        JasperPrint print = format.getJasperPrint(requestData, config, file, getTaskDirectory()).print;
        BufferedImage reportImage = ImageSimilarity.exportReportToImage(print, 0);

        // note that we are using a sample size of 50, because the image is quite big.
        // otherwise small differences are not detected!
        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(baseDir + "expectedImage.png"), 10);
    }
View Full Code Here

//        ImageIO.write(reportImage, "png", new File("e:/tmp/expectedImage.png"));

        // note that we are using a sample size of 50, because the image is quite big.
        // otherwise small differences are not detected!
        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(baseDir + "expectedImage.png"), 10);
    }
View Full Code Here

        JasperPrint print = format.getJasperPrint(requestData, config, file, getTaskDirectory()).print;
        BufferedImage reportImage = ImageSimilarity.exportReportToImage(print, 0);
//        ImageIO.write(reportImage, "png", new File("e:/tmp/testColumnImageConverter.png"));
        // note that we are using a sample size of 50, because the image is quite big.
        // otherwise small differences are not detected!
        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(baseDir + "expectedImage.png"), 10);
    }
View Full Code Here

        JasperPrint print = format.getJasperPrint(requestData, config, file, getTaskDirectory()).print;
        BufferedImage reportImage = ImageSimilarity.exportReportToImage(print, 0);
//        ImageIO.write(reportImage, "png", new File("/tmp/testColumnImageConverter.png"));
        // note that we are using a sample size of 50, because the image is quite big.
        // otherwise small differences are not detected!
        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(baseDir + "expectedImage.png"), 10);
    }
View Full Code Here

        JasperPrint print = format.getJasperPrint(requestData, config, file, getTaskDirectory()).print;
        BufferedImage reportImage = ImageSimilarity.exportReportToImage(print, 0);
//        ImageIO.write(reportImage, "png", new File("/tmp/expectedImage.png"));
        // note that we are using a sample size of 50, because the image is quite big.
        // otherwise small differences are not detected!
        new ImageSimilarity(reportImage, 50).assertSimilarity(getFile(baseDir + "expectedImage.png"), 10);
    }
View Full Code Here

//      ImageIO.write(referenceImage, "png", new File("e:/tmp/expectedSimpleImage.png"));
//      Files.copy(new File(layerGraphics.get(0)), new File("e:/tmp/0_"+getClass().getSimpleName()+".tiff"));
//      Files.copy(new File(layerGraphics.get(1)), new File("e:/tmp/1_"+getClass().getSimpleName()+".tiff"));

        new ImageSimilarity(referenceImage, 2).assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.png"), 30);

    }
View Full Code Here

        List<URI> layerGraphics = (List<URI>) values.getObject("layerGraphics", List.class);
        assertEquals(1, layerGraphics.size());

        final BufferedImage img = ImageIO.read(new File(layerGraphics.get(0)));
//        ImageIO.write(img, "tiff", new File("/tmp/expectedSimpleImage.tiff"));
        new ImageSimilarity(img, 2).assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 30);
    }
View Full Code Here

        assertEquals(2, layerGraphics.size());

        final BufferedImage actualImage = ImageSimilarity.mergeImages(layerGraphics, 300, 200);
        ImageSimilarity.writeUncompressedImage(actualImage, "/tmp/expectedSimpleImage.tiff");
//        ImageIO.write(actualImage, "tiff", new File("/tmp/expectedSimpleImage.tiff"));
        new ImageSimilarity(actualImage, 2)
                .assertSimilarity(getFile(BASE_DIR + "expectedSimpleImage.tiff"), 50);

    }
View Full Code Here

TOP

Related Classes of org.mapfish.print.test.util.ImageSimilarity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.