Gulivertx / synology-photos-auto-sort

Script to use exiftool on a Synology NAS or any bash environment to auto sort images from a folder
MIT License
54 stars 16 forks source link

grep misinterpreting the input as binary #7

Closed kaili82 closed 1 year ago

kaili82 commented 3 years ago

executing DATETIME=$(exiftool ${FILE} | grep -i "create date" | head -1 | xargs) returns DATETIME = "Binary file (standard input) matches". Therefore, the script doesn't work on my synology.

Solution: add the option -a to make grep treat the input as text. Therefore, please replace the line with DATETIME=$(exiftool ${FILE} | grep -a -i "create date" | head -1 | xargs)

Gulivertx commented 1 year ago

Thanks, now fixed with new option -a