aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/010-libphotofloat.js
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2015-01-27 14:25:06 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2015-01-27 14:25:06 +0100
commit8956a6c9a5a08cbebd418da1019d625ae3ac1bb6 (patch)
tree0d49130c89cdb28812bdee8d6eda5ffa78b5130e /web/js/010-libphotofloat.js
parentCopy and paste error (diff)
downloadPhotoFloat-8956a6c9a5a08cbebd418da1019d625ae3ac1bb6.tar.xz
PhotoFloat-8956a6c9a5a08cbebd418da1019d625ae3ac1bb6.zip
Don't prefix root for images
Diffstat (limited to '')
-rw-r--r--web/js/010-libphotofloat.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/js/010-libphotofloat.js b/web/js/010-libphotofloat.js
index 0a84014..f8a1107 100644
--- a/web/js/010-libphotofloat.js
+++ b/web/js/010-libphotofloat.js
@@ -137,12 +137,15 @@
return PhotoFloat.cachePath(album.parent.path + "/" + album.path);
};
PhotoFloat.photoPath = function(album, photo, size, square) {
- var suffix;
+ var suffix, hash;
if (square)
suffix = size.toString() + "s";
else
suffix = size.toString();
- return "cache/" + PhotoFloat.cachePath(PhotoFloat.photoHash(album, photo) + "_" + suffix + ".jpg");
+ hash = PhotoFloat.cachePath(PhotoFloat.photoHash(album, photo) + "_" + suffix + ".jpg");
+ if (hash.indexOf("root-") === 0)
+ hash = hash.substring(5);
+ return "cache/" + hash;
};
PhotoFloat.originalPhotoPath = function(album, photo) {
return "albums/" + album.path + "/" + photo.name;