Optimizing...
[1/1] /home/pi/xulyanh/799795.jpg... stat: cannot read file system information for '%Lp': No such file or directory
chmod: invalid mode: ‘File:’
Try 'chmod --help' for more information.
[NOT OPTIMIZED] 984.9Kb
(1) -f | --file <filepath> — direct path to a single (or multiple?) png/jpg/gif file(s) instead of directory path using -p
(2) -x | --non-destructive — keep the original file and write the new optimized file as <filename>-optimized.<extension> in the same working directory … alternatively: keep the original file as <filename>-original.<extension> … you'd have to be able to execute this together with e.g. -q and -l etc.
After optimization is finished, the script deletes this file (or deletes current path to working directory from the file with several parallel optimizations). This is done to prevent cycling optimization and avoid conflicts during optimization for longer than period between optimizations.
There was a lot of thought put into working around re-optimising previously processed files.
I think xattrs pose a good solution to mark the files once processes to not be touched again. What do you think?
I have written a blog post and readers have a major concerns about PNG files, they want it to be filtered - that means compress on jpeg files, if there is any provision in this bash?