Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserving timestamps #360

Open
jagdishadusumalli opened this issue Jul 18, 2020 · 7 comments
Open

Preserving timestamps #360

jagdishadusumalli opened this issue Jul 18, 2020 · 7 comments

Comments

@jagdishadusumalli
Copy link

jagdishadusumalli commented Jul 18, 2020

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?

@zvezdochiot
Copy link

zvezdochiot commented Jul 18, 2020

Hi @jagdishadusumalli .

Use stat and touch.

PS: ⚠️ I'm not familiar with macOS.

@kornelski
Copy link
Owner

No, unfortunately there's no option to preserve timestamps.

@jagdishadusumalli
Copy link
Author

Hi @kornelski Can we please add this into our "Feature Requests".
Will be a worth addition to this great tool.

@dverbru
Copy link

dverbru commented Oct 23, 2021

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.

@kornelski kornelski reopened this Oct 23, 2021
@prakash-partho
Copy link

Hello @kornelski
I also request to have an option to preserve timestamps.

@tobias992
Copy link

Hello Devs,
any news with the --preserve option? To leave the old file attributes would be a very nice and helpful feature.

@kornelski kornelski changed the title How to preserve the timestamps of files on macOS 10.15.6 using pngquant 1.1 Preserving timestamps Jan 24, 2023
@ReessKennedy
Copy link

+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!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants