Исправлено неправильное масштабирование картинки в настройках команд

develop 3.6.8.2
parent 0e64c766e0
commit 67a2f02c40

@ -2654,10 +2654,12 @@ class ImageLabel(qt.QLabel):
convert_cmd = getProgPath('/usr/bin/convert') convert_cmd = getProgPath('/usr/bin/convert')
identify_cmd = getProgPath('/usr/bin/identify') identify_cmd = getProgPath('/usr/bin/identify')
def convert_image(source, res, target): def convert_image(source, res, target):
command = [convert_cmd, "-quality", "95", command = [convert_cmd, "-quality", "100",
source, "-resize", "%s^" % res, source, "-resize", "%s" % res,
"-strip", "-gravity", "center", "-strip",
"-crop", "%s+0+0" % res, target] target]
#"-strip", "-gravity", "center",
#"-crop", "%s+0+0" % res, target]
convert = process(*command, stderr=STDOUT) convert = process(*command, stderr=STDOUT)
if convert.success(): if convert.success():
return True return True
@ -2674,7 +2676,7 @@ class ImageLabel(qt.QLabel):
if cx and cy: if cx and cy:
if convert_image(source_path, "{}x{}".format(cx, height), if convert_image(source_path, "{}x{}".format(cx, height),
output_path): output_path):
return (cx, cy) return get_image_resolution(output_path)
return None return None
if len(list_data) == 3: if len(list_data) == 3:
@ -2707,7 +2709,7 @@ class ImageLabel(qt.QLabel):
style += "background-repeat: %s; " %repeat_dict[repeat.lower()] style += "background-repeat: %s; " %repeat_dict[repeat.lower()]
style += "border-bottom: 1px solid #B8B3B0;" style += "border-bottom: 1px solid #B8B3B0;"
self.setStyleSheet(style) self.setStyleSheet(style)
self.setFixedHeight(height_image) self.setFixedHeight(sizes[1])
def get_view_params(client, method, step = None, expert = None, brief = None): def get_view_params(client, method, step = None, expert = None, brief = None):
view_params = create_obj(client, method) view_params = create_obj(client, method)

Loading…
Cancel
Save