Updated python dependencies to latest
Fixed thumbnail generator script
This commit is contained in:
parent
baeee2e48b
commit
6c27027dd6
3 changed files with 174 additions and 158 deletions
|
@ -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()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue