summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils <git@velohero.com>2016-11-06 19:45:28 +0100
committerNils <git@velohero.com>2016-11-06 19:45:28 +0100
commit8abd528bb3e23704028b49353d614a8affea3f8d (patch)
tree0345464389a76ee04ecf562d1eabdadde0f8cdaf
parent83560c97b635622897c5c801d3960579bfdf732f (diff)
add mp4 files to gallery
-rw-r--r--README.md4
-rwxr-xr-xgallery.sh18
2 files changed, 16 insertions, 6 deletions
diff --git a/README.md b/README.md
index 95d2042..62ce511 100644
--- a/README.md
+++ b/README.md
@@ -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
-----------
diff --git a/gallery.sh b/gallery.sh
index b655339..7e66605 100755
--- a/gallery.sh
+++ b/gallery.sh
@@ -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