Wow - that looks and sounds great Andrea. +1 from me.

Does "an eventually installed perceptualdiff" mean that you had a lot
of trouble installing it ?  I just tried the pre-compiled binary for
OSX and it seems to work.

Michael

On 28 March 2011 05:58, Andrea Aime <[email protected]> wrote:
> Hi,
> I put toghether some tooling that can compare images against
> references using an eventually installed perceptualdiff.
>
> The user visible class is called ImageAssert, and exposes these
> two methods:
>
> public static void assertEquals(File expectedFile, RenderedImage
> actualImage, int threshold);
> public static void assertEquals(RenderedImage expectedImage,
> RenderedImage actualImage,
>            int threshold);
>
> The threshold is the number of pixels that can be perceptually
> different without having to
> consider the image different (useful for images with fonts for
> example, and to allow some
> changes in the antialiasing).
>
> The tool will perform the assert only if perceptualdiff is in the
> path, otherwise it will
> emit a warning and exit peacefully (no test failures).
>
> If the first method does not find the expectedFile and the
> org.geotools.image.test.interactive=true
> system variable is set it will pop up a dialog asking for visual
> inspection, if the user
> gives a positive result it will save the image as the expected file.
> (see savereference.png, attached).
>
> If the same variable is set and the two images are not equal a dialog helping 
> to
> compare the image will be shown (compare.png).
> Maybe the image changed enough for the tool to trigger on it, but the result
> might be good anyways (e.g. the label placement were changed), if so the
> user can overwrite the reference.
>
> In case the variable is not set the tests will fail without popping up
> any dialog.
>
> What do you think? Seems useful enough to me, if we find a significant
> platform/jdk/font
> variation we can just raise the threshold without giving up the test 
> altogheter.
>
> The only major thing we'd need is to have perceptualdiff installed on Hudson
> and on machines of anyone that is interested in rendering testing.
>
> Cheers
> Andrea
>
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
> mob:    +39 333 8128928
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to