I need to execute jpeg-recompress on thousands of files. I've tried:
for image in *.jpg; do
image2=${image%.*}.jpg;
./jpeg-recompress /path/to/images/$image /path/to/images/$image2;
echo "Processing $image2 file...";
done
But fails to do so arguing that the: Maximum number of arguments exceeded
I tried using find, something like:
find /path/to/images -iname “*.jpg” | while read image; do
(and the rest of the previous argument)
But it doesn't seem to do anything. I was wondering how could I take advantage of this program on multiple files?
jpeg-recompress image.jpg image.jpg
(Does replace the original, as intended)