Bug 8824

Summary: Remove tIME chunks from PNG output
Product: cairo Reporter: Nigel Tao <nigel.tao.gnome>
Component: png functionsAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 1.2.5   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Nigel Tao 2006-10-29 19:39:16 UTC
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
Comment 1 Behdad Esfahbod 2006-10-30 07:41:22 UTC
This is also true for the PS output and possibly others.
Comment 2 Andrew McRae 2006-11-12 19:51:53 UTC
I have some diffs to parameterise some of the PNG file creation
options that addresses this issue.
Comment 3 Chris Wilson 2008-09-28 10:31:14 UTC
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.