Updated python dependencies to latest

Fixed thumbnail generator script
This commit is contained in:
Felipe M 2020-11-08 17:35:18 +01:00
parent baeee2e48b
commit 6c27027dd6
Signed by: fmartingr
GPG key ID: 716BC147715E716F
3 changed files with 174 additions and 158 deletions

View file

@ -4,8 +4,7 @@ import shutil
from lektor.build_programs import AttachmentBuildProgram, buildprogram
from lektor.context import get_ctx
from lektor.db import Image
from lektor.imagetools import (computed_height, find_imagemagick,
get_image_info, get_quality)
from lektor.imagetools import compute_dimensions, get_image_info, get_quality, find_imagemagick
from lektor.pluginsystem import Plugin
from lektor.reporter import reporter
from lektor.utils import portable_popen
@ -77,9 +76,9 @@ class ResizedImageBuildProgram(AttachmentBuildProgram):
width = int(conf["max_width"])
height = int(conf.get("max_height", "0"))
quality = int(conf.get("quality", "100"))
if not height:
height = computed_height(source_img, width, w, h)
computed_width, height = compute_dimensions(w, h, width, height)
# height = compute_dimensions(source_img, width, w, h)
df = artifact.source_obj.url_path
ext_pos = df.rfind(".")
@ -117,4 +116,4 @@ class ThumbnailGeneratorPlugin(Plugin):
@cached_property
def config(self):
conf = self.get_config()
return {section: conf.section_as_dict(section) for section in conf.sections()}
return {section: conf.section_as_dict(section) for section in conf.sections()}