oxipng
oxipng copied to clipboard
Feature request: Machine-readable CLI output
Would be great to have a --json flag, or something similar. As it stands, if one wants to integrate Oxipng into another CLI tool (like I'm trying to do at my company), it's not really possible to easily parse the CLI output and figure out what images were optimized vs skipped.
Example output might be something like:
{
"result": "success",
"images": [
{ "path": "/path/to/image.png",
"original_size": 13232,
"optimized_size": 11323,
},
// ...
]
}
Could pipe more and more into these objects over time (like timing data, or what optimizations were applied, etc.)
Seems to be conceptually similar to https://github.com/shssoichiro/oxipng/pull/501, but those "verbosities" don't seem to do for this.
Are you able to use the oxipng API in your CLI tool?
Are you able to use the oxipng API in your CLI tool?
As in, the Rust API? If so then no, my particular use case is adding some image optimization utilities to my company's Python-based dev cli, so shelling out is a must. The alternative would be to write a rust wrapper that gives machine-readable output I guess.
Hm, you may like to check this out: https://pypi.org/project/pyoxipng/
Thanks! I still think it'd be great for oxipng to support machine-readable output but this will likely solve my particular use case.