From 8956a6c9a5a08cbebd418da1019d625ae3ac1bb6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 27 Jan 2015 14:25:06 +0100 Subject: Don't prefix root for images --- web/js/010-libphotofloat.js | 7 +++++-- 1 file 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; -- cgit v1.2.3-59-g8ed1b