Hi all,
its not so much a problem as I really cant quite get my head round it. What I am attempting to do is run a cron job which looks through a specific directory of images and then uses convert from the image magic package to compress the image if it is over a certain size.
Find all command to ls -lh all files > 300kb in size:
$ find . -size +300k -type f -exec ls -lh {} \;
ImageMagicks convert command to compress a single file(compress JPEG/quality 75).
$ convert -compress JPEG -quality 75 image.jpg image.jpg
So how can we combine these two commands? We can either do a convert using a wildcard which I am unsure even exists in converts functionality or when performing find we pass across the value of the filename, something like:
$ find . -size +300k -type f -exec convert -compress JPEG -quality 75 $filename $filename {} \;
I have already experimented with wildcard operations to no avail.
Any help you can offer would be massively appreciated.