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

File process order? #586

Closed
someonenameguy opened this issue Dec 16, 2023 · 4 comments
Closed

File process order? #586

someonenameguy opened this issue Dec 16, 2023 · 4 comments

Comments

@someonenameguy
Copy link

someonenameguy commented Dec 16, 2023

Is there a way to tell oxipng to process file in like "Time Created Descending" or "Last Modified First"?

I mistakenly pressed enter on my phone while trying to type so this was empty.

@someonenameguy someonenameguy changed the title Fore File process order Dec 16, 2023
@someonenameguy someonenameguy changed the title File process order File process order? Dec 16, 2023
@ace-dent
Copy link

This sounds like something you can achieve with your shell/ OS...? Or perhaps with a command line script? Could you describe your use case in more detail?

@andrews05
Copy link
Collaborator

Yeah, if you're using zsh for instance, you can use glob qualifiers to change the order (see oc and Oc).
E.g.

for file in *.png(Om); do
    oxipng $file
done

Note I'm using a loop here as oxipng's rayon thread pool will not guarantee order if you just feed them all in directly.

@someonenameguy
Copy link
Author

someonenameguy commented Dec 17, 2023

I am using oxipng on Windows and Termux.

I have a folder where images are saved automatically(eg. downloads) but there no name scheme. All the pngs in it have been ran through oxipng and been optimized. Now I save new images then run:
oxipng -rpo 1 .\
It seems to process some of the old file first then the new ones then the old ones.

The file have correct modif and create time stamps so I was wondering if oxipng could use that.

I asked chatgpt about glob qualifiers for windows and termux, it seems there a way to do it in the ?os?.
for /f "delims=" %%a in ('dir /b /o-d /tw') do set "filename=%%a" for windows and for file in $(ls -t); do for termux.

If I missing some easier way to do it inside of oxipng please tell.
If not, you can close this.

@andrews05
Copy link
Collaborator

There's no way to do this with oxipng itself I'm afraid.
It sounds like what you're really wanting to do is skip files that have already been processed. This is also not possible with oxipng itself (see #549) but perhaps you could move the files to another folder after processing?

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

3 participants