Created
July 25, 2019 19:47
-
-
Save trauber/8e82c70dba4dba5e099f255fe36a34d2 to your computer and use it in GitHub Desktop.
Make a JSON List of Photos #json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use find and file to crawl for files with mime-type image/jpeg or image/png. | |
# Awk isolates file names. | |
# rjgpcom gets comments, if any. | |
# jo wraps everything up into json for jsongallery. | |
# | |
# https://jpmens.net/2016/03/05/a-shell-command-to-create-json-jo | |
# https://github.com/mariobox/jsongallery | |
findlist=$(find . -type f -exec file -i {} \; \ | |
| awk '{if ($2 == "image/jpeg;" || $2 == "image/png;") {img=$1; sub(/:$/,"",$1);print $1}}') | |
for j in $findlist; do | |
comment=$(rdjpgcom $j 2>&1) | |
jo url=$j description="$comment" | |
done | jo -p -a | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment