[libGD] #230 [Task opened] Test gdimageline_aa fails for gdimageline_aa_d_*_exp.png

[email protected] Sat, 2 Oct 2010 03:45:06 +0200 (CEST)
Newsgroups php.gd.bugs
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Jim DeLaHunt (JimDeLaHunt) 

Attached to Project - libGD
Summary - Test gdimageline_aa fails for gdimageline_aa_d_*_exp.png
Task Type - Bug Report
Category - Drawing function
Status - Unconfirmed
Assigned To - 
Operating System - Other
Severity - Low
Priority - Normal
Reported Version - 2.0.35
Due in Version - Undecided
Due Date - Undecided
Details - I built gd 2.0.35 and ran the built-in tests on my machine. All tests passed except for gdimageline_aa.  This test exercises anti-aliased line drawing, generating eight different images and comparing them to references supplied with gd.  Two of those eight failed.  

How to reproduce bug:
* Unarchive gd 2.0.35 source code on a Mac OS X 10.5.8 machine using the default compiler (I think /usr/bin/gcc).
* cmake, make all, make install as needed.
* ctest . to run all the tests.

Observed behaviour:
* Output from ctest . is:
<code>The following tests FAILED:
	  5 - gdimageline_aa (Failed)
</code>
* In root of project directory, the following files appear (attached):
gdimageline_aa.c_38_diff.png	gdimageline_aa.c_41_diff.png
gdimageline_aa.c_38_out.png	gdimageline_aa.c_41_out.png

The *_out.png files appear to be the images generated by the test code, and the *_diff.png files appear to be images containing differences between the test output and the reference.   These files are attached.

Expected behaviour:
* All tests pass.

Looking at the *_diff.png files, it appears that the left end of the diagonal lines are lower (larger +y coordinate) in the test output than in the reference.

To check this, I patched tests/gdimageline/gdimageline_aa.c to print out the parameters it uses to draw the diagonal line, when a test case fails. Patch is attached.  Here's the output I received when running the test standalone (paths and line wraps edited):

<code>% ./tests/gdimageline/gdimageline_aa
..../tests/gdimageline/gdimageline_aa_a_0_exp.png draws line from -10,-49 to 20,100.
   Width: 10, height 100, idx 0, reverse_x 1, gradient 5.000000, offset 0.
..../tests/gdimageline/gdimageline_aa_a_1_exp.png draws line from -10,0 to 20,150.
   Width: 10, height 100, idx 1, reverse_x 1, gradient 5.000000, offset 10.
..../tests/gdimageline/gdimageline_aa_b_0_exp.png draws line from 10,50 to -20,200.
   Width: 10, height 100, idx 2, reverse_x -1, gradient 5.000000, offset 20.
..../tests/gdimageline/gdimageline_aa_b_1_exp.png draws line from 10,0 to -20,150.
   Width: 10, height 100, idx 1, reverse_x -1, gradient 5.000000, offset 10.
..../tests/gdimageline/gdimageline_aa_c_0_exp.png draws line from -100,-4 to 200,10.
   Width: 100, height 10, idx 0, reverse_x 1, gradient 0.050000, offset 0.
..../tests/gdimageline/gdimageline_aa_c_1_exp.png draws line from -100,0 to 200,15.
   Width: 100, height 10, idx 1, reverse_x 1, gradient 0.050000, offset 100.
..../tests/gdimageline/gdimageline_aa_d_0_exp.png draws line from 100,5 to -200,20.
   Width: 100, height 10, idx 2, reverse_x -1, gradient 0.050000, offset 200.
..../tests/gdimageline/gdimageline_aa_d_0_exp.png failed
..../tests/gdimageline/gdimageline_aa_d_1_exp.png draws line from 100,0 to -200,15.
   Width: 100, height 10, idx 1, reverse_x -1, gradient 0.050000, offset 100.
..../tests/gdimageline/gdimageline_aa_d_1_exp.png failed
</code>

Does anyone else using gcc on a Mac OS X 10.5.8 OS get this test to pass when first compiled?

The test case per se is low severity, because it's no big deal to a user if a test case fails. However, if it points to some variance in gd behaviour, then that variance could cause a more severe bug in the field.

More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=230

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.