[cairo] Removing tIME chunks from PNG output
Nigel Tao
nigeltao at gnome.org
Sun Aug 20 22:23:57 PDT 2006
cairo's PNG output includes a tIME chunk. cairo-png.c line 174-175:
-------------------------------
png_convert_from_time_t (&pt, time (NULL));
png_set_tIME (png, info, &pt);
-------------------------------
However,
1) this makes the resultant PNG files (very slightly) bigger.
2) this is unnecessary - it does not affect what an image viewer (e.g.
eog) displays, since tIME is an "ancillary [PNG] chunk".
3) this means that every time I run my code, the output changes, even
if the code itself does not. This is my biggest concern, because it
means that I can't use vanilla cairo to write unit tests that looks
like this:
-------------------------------
string golden_output = load_file("golden.png");
string actual_output = use_cairo_to_draw_stuff_to_png(...);
assert_equal(golden_output, actual_output);
-------------------------------
It also looks like this has come up before - search for "XXX: Setting
the time is interfereing with the image comparison" or just read the
Log Message at the top of
http://lists.freedesktop.org/archives/cairo-commit/2004-May/000886.html
Now, hooray for open source, I can just patch my own copy of cairo to
remove these two lines. But should this go upstream?? Is there a
reason why tIMEs are useful/required, or should we just nuke it out
for the 1.4 series?
Nigel.
More information about the cairo
mailing list