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? As raised in the mailing list [1], and re-posted to bugzilla so that it can be tracked, even if the conclusion is a simple WONTFIX. :-) [1] http://lists.freedesktop.org/archives/cairo/2006-August/007690.html
This is also true for the PS output and possibly others.
I have some diffs to parameterise some of the PNG file creation options that addresses this issue.
Done - since this aids cairo debugging which is the sole purpose of the cairo_surface_write_to_png().
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.