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
Option to output to another filename #14
Comments
Starting from v1.4.0, jpegoptim supports stdin/stdout. So, now there is couple ways to do what you want: jpegoptim --stdout a.jpg > b.jpg or cat a.jpg | jpegoptim --stdin > b.jpg |
To use stdin/stdout you have to use a shell. The binary itself is not capable of outputting to another filename, which in my opinion is a weakness/missing feature. |
If anyone is stuck with this, you can get a little creative by doing this.
Here is a small bash script: img='test.jpg'
cp $img ${img%.*}-optimized.jpg
jpegoptim ${img%.*}-optimized.jpg |
Currently you support batch image processing nicely by offering destination directory option, however if a user wants to optimize just a single image with a different file name, he can't. I think having 2 parameters one for input and one for output can help in this case and it seems reasonable to have this support in this awesome optimizer.
The text was updated successfully, but these errors were encountered: