Menu

#20 -preserve truncates timestamps to 1 s resolution

closed
None
5
2012-03-08
2010-09-28
No

(Metadata loss) High-resolution timestamps are significant for many applications; for example, many cameras can capture sequences of images at several frames per second, so truncating to one-second resolution would destroy the ordering.

Example of bug:
# Running in a terminal:
# image.png is any PNG image
username@host:/dev/shm/asdf$ touch --date='2010-09-22 01:23:45.678901234 +0000' image.png
username@host:/dev/shm/asdf$ ls --full-time
total 4
-rw-r--r-- 1 username username 152 2010-09-22 01:23:45.678901234 +0000 image.png
username@host:/dev/shm/asdf$ optipng -preserve image.png
OptiPNG 0.6.3: Advanced PNG optimizer.
Copyright (C) 2001-2009 Cosmin Truta.

** Processing: image.png
114x62 pixels, 3x8 bits/pixel, RGB
Reducing image to 1 bit/pixel, 1 color in palette
Input IDAT size = 43 bytes
Input file size = 152 bytes

Trying:
zc = 9 zm = 8 zs = 0 f = 0 IDAT size = 17
zc = 9 zm = 8 zs = 1 f = 0 IDAT size = 17
zc = 9 zm = 8 zs = 3 f = 0 IDAT size = 17
zc = 9 zm = 8 zs = 0 f = 5 IDAT size = 17
zc = 9 zm = 8 zs = 1 f = 5 IDAT size = 17
zc = 9 zm = 8 zs = 3 f = 5 IDAT size = 17

Selecting parameters:
zc = 9 zm = 8 zs = 3 f = 0 IDAT size = 17

Output IDAT size = 17 bytes (26 bytes decrease)
Output file size = 141 bytes (11 bytes = 7.24% decrease)

username@host:/dev/shm/asdf$ ls --full-time
total 4
-rw-r--r-- 1 username username 141 2010-09-22 01:23:45.000000000 +0000 image.png
# Timestamp has been truncated!

Discussion

  • Cosmin Truta

    Cosmin Truta - 2010-10-02

    I acknowledge your request. This isn't a bug, it's a missing feature under the Unix port. (The Windows port is fine.)

    This is happening because I am using the POSIX standard functions stat() and utime() via time_t, instead of the stat() and utimes() via timeval.

    I am moving this to the Feature Requests section.

     
  • Cosmin Truta

    Cosmin Truta - 2010-10-02
    • assigned_to: nobody --> cosmin
    • status: open --> open-later
     
  • Ramona Truta

    Ramona Truta - 2012-03-08
    • status: open-later --> closed
     
  • Ramona Truta

    Ramona Truta - 2012-03-08

    Done.

     

Log in to post a comment.