diff --git a/docs/changelog.rst b/docs/changelog.rst index c2ff20e..237534f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -16,6 +16,7 @@ Sigal now requires Python 3.11+. - Fix theme URL for photoswipe. - Thumbnail can now be set in ``index.md`` either with the original filename or with the thumbnail name after format conversion [:issue:`476`]. +- Allow portrait orientation for thumbnails [:issue:`531`]. Version 2.5 ~~~~~~~~~~~ diff --git a/src/sigal/settings.py b/src/sigal/settings.py index e81b670..0026d2a 100644 --- a/src/sigal/settings.py +++ b/src/sigal/settings.py @@ -194,7 +194,7 @@ def read_settings(filename=None): settings[p] = abspath(normpath(join(settings_path, path))) logger.debug("Rewrite %s : %s -> %s", p, path, settings[p]) - for key in ("img_size", "thumb_size", "video_size"): + for key in ("img_size", "video_size"): if settings[key]: w, h = settings[key] if h > w: diff --git a/tests/test_settings.py b/tests/test_settings.py index 2ee7872..e08e09f 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -36,10 +36,14 @@ def test_img_sizes(tmpdir): """Test that image size is swaped if needed.""" conf = tmpdir.join("sigal.conf.py") - conf.write("thumb_size = (150, 200)") + conf.write( + "img_size = (600, 800)\n" + "thumb_size = (150, 200)" + ) settings = read_settings(str(conf)) - assert settings["thumb_size"] == (200, 150) + assert settings["img_size"] == (800, 600) + assert settings["thumb_size"] == (150, 200) def test_theme_path(tmpdir):