Blame Y2KINFO

Packit 0ba690
   Y2K compliance in libpng:
Packit 0ba690
   =========================
Packit 0ba690
Packit 0ba690
      December 29, 2016
Packit 0ba690
Packit 0ba690
      Since the PNG Development group is an ad-hoc body, we can't make
Packit 0ba690
      an official declaration.
Packit 0ba690
Packit 0ba690
      This is your unofficial assurance that libpng from version 0.71 and
Packit 0ba690
      upward through 1.2.57 are Y2K compliant.  It is my belief that earlier
Packit 0ba690
      versions were also Y2K compliant.
Packit 0ba690
Packit 0ba690
      Libpng only has three year fields.  One is a 2-byte unsigned integer
Packit 0ba690
      that will hold years up to 65535.  The other two hold the date in text
Packit 0ba690
      format, and will hold years up to 9999.
Packit 0ba690
Packit 0ba690
      The integer is
Packit 0ba690
          "png_uint_16 year" in png_time_struct.
Packit 0ba690
Packit 0ba690
      The strings are
Packit 0ba690
          "png_charp time_buffer" in png_struct and
Packit 0ba690
          "near_time_buffer", which is a local character string in png.c.
Packit 0ba690
Packit 0ba690
      There are seven time-related functions:
Packit 0ba690
Packit 0ba690
          png_convert_to_rfc_1123() in png.c
Packit 0ba690
            (formerly png_convert_to_rfc_1152() in error)
Packit 0ba690
          png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
Packit 0ba690
          png_convert_from_time_t() in pngwrite.c
Packit 0ba690
          png_get_tIME() in pngget.c
Packit 0ba690
          png_handle_tIME() in pngrutil.c, called in pngread.c
Packit 0ba690
          png_set_tIME() in pngset.c
Packit 0ba690
          png_write_tIME() in pngwutil.c, called in pngwrite.c
Packit 0ba690
Packit 0ba690
      All appear to handle dates properly in a Y2K environment.  The
Packit 0ba690
      png_convert_from_time_t() function calls gmtime() to convert from system
Packit 0ba690
      clock time, which returns (year - 1900), which we properly convert to
Packit 0ba690
      the full 4-digit year.  There is a possibility that applications using
Packit 0ba690
      libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
Packit 0ba690
      function, or that they are incorrectly passing only a 2-digit year
Packit 0ba690
      instead of "year - 1900" into the png_convert_from_struct_tm() function,
Packit 0ba690
      but this is not under our control.  The libpng documentation has always
Packit 0ba690
      stated that it works with 4-digit years, and the APIs have been
Packit 0ba690
      documented as such.
Packit 0ba690
Packit 0ba690
      The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned
Packit 0ba690
      integer to hold the year, and can hold years as large as 65535.
Packit 0ba690
Packit 0ba690
      zlib, upon which libpng depends, is also Y2K compliant.  It contains
Packit 0ba690
      no date-related code.
Packit 0ba690
Packit 0ba690
Packit 0ba690
         Glenn Randers-Pehrson
Packit 0ba690
         libpng maintainer
Packit 0ba690
         PNG Development Group