Open jagdishadusumalli opened 4 years ago
Hi @jagdishadusumalli .
Use stat
and touch
.
PS: :warning: I'm not familiar with macOS.
No, unfortunately there's no option to preserve timestamps.
Hi @kornelski Can we please add this into our "Feature Requests". Will be a worth addition to this great tool.
Hello @kornelski
I second the request to have an option to preserve timestamps, like optipng's --preserve
option and pngcrush's -oldtimestamp
option. It is very useful when compressing old files! Would you consider it? Should I submit it again as a new issue? Thanks.
Hello @kornelski I also request to have an option to preserve timestamps.
Hello Devs, any news with the --preserve option? To leave the old file attributes would be a very nice and helpful feature.
+1 but I also wrote some code that does this: https://www.reesskennedy.com/compression-enhancer/
It's PHP so super easy to run and then runs some shell commands to get the original creation and add it back after compression. I use it every day!
Could be translated to Python or anything. Perhaps some of your do something similar already and I know this is a request to add this directly into PNGQuant but just sharing a solution!!!!
I have screenshots taken from 2016 and after and dont want to loose the timestamps of the files after optimization i know the filenames have the datetime info but i rely on file meta info.
I ran the command as many ways as below pngnq ~/Desktop/.png (creates new files) pngnq -f -e .png ~/Desktop/.png (replaces the old files)
All optimized files have Created/ Modified/ Added date set as Today after the processing.
I tried pngnq and it has a -p flag (preserve timestamps) and it works perfectly but the quality is a bit low
How can we keep the old timstamps preserved on files with pngquant?