-
Notifications
You must be signed in to change notification settings - Fork 125
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
Faster method to bail on already optimized pngs? #628
Comments
Hi @montehurd, this is an interesting topic that has come up a few times. See #549, #564 and #566. Looking at the PR you linked to, it looks there already was a wrapper script that did what you're suggesting? I'll close this as a duplicate, but feel free to add your ideas to the thread in #549. |
Thanks @andrews05 That makes sense Quick question - is the stdin input option working? I tried to adapt my previous wrapper script logic to pipe the list of yet-to-be optimized image paths to oxipng's stdin, with the hope oxipng could take that list and still manage spawning optimization threads across cpu cores, but I couldn't even get a single image to be optimized via stdin... wondering if maybe stdin functionality is currently broken? |
Ah, the stdin doesn't take a path list sorry, it takes the content of a single png directly (intended for piping). You might have to use xargs or something to process a path list. |
Done! #629 |
Is there a way to make oxipng bail more quickly on images it has already optimized?
Could perhaps a flag be added which causes oxipng to write a eXIf Comment (perhaps set to "OptimizedByOxipng"?) to pngs upon being successfully optimized by it?
The flag would also cause oxipng to check for that eXIf Comment's presence in images, so it could bail more immediately upon detecting it
Maybe the flag could be called a variant of
--flag-and-skip-optimized
?Context:
I'm using this once daily in my Docker container:
CMD ["oxipng", "--fix", "--recursive", "-o", "2", "."]
My dir has many subdirs with thousands of images
A fraction of these screenshot images are re-captured daily
I love the simplicity of just running oxipng recursively, especially given how effectively it utilizes available processor cores
But it would be amazing if it could devote less time to already optimized images without the user having to determine the subset of images which have yet to be optimized
Thanks for consideration and any feedback!
The text was updated successfully, but these errors were encountered: