diff --git a/dist/main.js b/dist/main.js index 9c58827..4b9c0a1 100644 Binary files a/dist/main.js and b/dist/main.js differ diff --git a/src/scripts/photo.js b/src/scripts/photo.js index 25c99d9..602cabf 100644 --- a/src/scripts/photo.js +++ b/src/scripts/photo.js @@ -549,6 +549,7 @@ photo = { // Default is big // Small is centered in the middle of the screen var size = 'big', + scaled = false, hasMedium = photo.json.medium!=="", pixelRatio = window.devicePixelRatio, view = { @@ -556,6 +557,11 @@ photo = { height: $(window).height()-100 }; + // Detect if the photo will be shown scaled, + // because the screen size is smaller than the photo + if (photo.json.width>view.width|| + photo.json.width>view.height) scaled = true; + // Calculate pixel ratio of screen if (pixelRatio!==undefined&&pixelRatio>1) { view.width = view.width * pixelRatio; @@ -567,9 +573,9 @@ photo = { if (hasMedium===true&& (1920>view.width&&1080>view.height)) size = 'medium'; - // Medium not available and + // Photo not scaled // Photo smaller then screen - if (hasMedium===false&& + if (scaled===false&& (photo.json.width