diff options
author | Nils <git@velohero.com> | 2016-11-06 19:45:28 +0100 |
---|---|---|
committer | Nils <git@velohero.com> | 2016-11-06 19:45:28 +0100 |
commit | 8abd528bb3e23704028b49353d614a8affea3f8d (patch) | |
tree | 0345464389a76ee04ecf562d1eabdadde0f8cdaf | |
parent | 83560c97b635622897c5c801d3960579bfdf732f (diff) |
add mp4 files to gallery
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | gallery.sh | 18 |
2 files changed, 16 insertions, 6 deletions
@@ -22,7 +22,7 @@ All you need is a place to host your plain html and jpeg files. This can also be Requirements ------------ * ImageMagick (http://www.imagemagick.org/) for the `convert` utility. -* JHead (https://wiki.ubuntuusers.de/JHead/) for EXIF data extraction +* JHead (http://www.sentex.net/~mwandel/jhead/) for EXIF data extraction On a debian-based system (Ubuntu), just run `apt-get install imagemagick jhead` as root. @@ -36,7 +36,7 @@ Usage `gallery.sh` works in the **current** directory. Just load the index.html in a browser see the output. The directory should contain a bunch of JPEG (.jpg or .JPG) files. It does not work recursively. -ZIP files (.zip or .ZIP) and movies (.mov or .MOV) are also considered. They appear as a download button in the gallery. +ZIP files (.zip or .ZIP) and movies (.mov, .MOV, .mp4 or .MP4) are also considered. They appear as a download button in the gallery. Screenshots ----------- @@ -201,8 +201,8 @@ done fi -### Movies (MOV) -if [[ $(ls -l | grep -i mov | wc -l) -gt 0 ]]; then +### Movies (MOV or MP4) +if [[ $(ls -l | grep -i "mov\|mp4" | wc -l) -gt 0 ]]; then cat >> "$htmlfile" << EOF <div class="row"> <div class="col-xs-12"> @@ -212,12 +212,22 @@ if [[ $(ls -l | grep -i mov | wc -l) -gt 0 ]]; then <div class="row"> <div class="col-xs-12"> EOF + if [[ $(ls -l | grep -i "mov" | wc -l) -gt 0 ]]; then for filename in *.[mM][oO][vV]; do - filesize=$(ls -lah $filename | awk '{ print $5}') + filesize=$(ls -lah "$filename" | awk '{ print $5}') cat >> "$htmlfile" << EOF <a href="$filename" class="btn btn-primary" role="button">$movieicon $filename ($filesize)</a> EOF done + fi + if [[ $(ls -l | grep -i "mp4" | wc -l) -gt 0 ]]; then + for filename in *.[mM][pP]4; do + filesize=$(ls -lah "$filename" | awk '{ print $5}') + cat >> "$htmlfile" << EOF +<a href="$filename" class="btn btn-primary" role="button">$movieicon $filename ($filesize)</a> +EOF + done + fi echo '</div></div>' >> "$htmlfile" fi @@ -233,7 +243,7 @@ if [[ $(ls -l | grep -i zip | wc -l) -gt 0 ]]; then <div class="col-xs-12"> EOF for filename in *.[zZ][iI][pP]; do - filesize=$(ls -lah $filename | awk '{ print $5}') + filesize=$(ls -lah "$filename" | awk '{ print $5}') cat >> "$htmlfile" << EOF <a href="$filename" class="btn btn-primary" role="button">$downloadicon $filename ($filesize)</a> EOF |