Mercurial > libervia-backend
diff sat/core/sat_main.py @ 3220:4fbea7f1e012
tools (images): methods renaming
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 22 Mar 2020 12:52:43 +0100 |
parents | ae09989e9feb |
children | 2f406b762788 |
line wrap: on
line diff
--- a/sat/core/sat_main.py Wed Mar 18 20:25:02 2020 +0100 +++ b/sat/core/sat_main.py Sun Mar 22 12:52:43 2020 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# SAT: a jabber client +# SàT: an XMPP client # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ from sat.memory import encryption from sat.tools import async_trigger as trigger from sat.tools import utils -from sat.tools import images +from sat.tools import image from sat.tools.common import dynamic_import from sat.tools.common import regex from sat.tools.common import data_format @@ -740,11 +740,11 @@ # images def _imageCheck(self, path): - report = images.checkImage(self, path) + report = image.check(self, path) return data_format.serialise(report) def _imageResize(self, path, width, height): - d = images.resizeImage(path, (width, height)) + d = image.resize(path, (width, height)) d.addCallback(lambda new_image_path: str(new_image_path)) return d @@ -760,7 +760,7 @@ @param path(Path): path to the image @return (Path): path to the generated preview """ - report = images.checkImage(self, path, max_size=(300, 300)) + report = image.check(self, path, max_size=(300, 300)) if not report['too_large']: # in the unlikely case that image is already smaller than a preview @@ -779,7 +779,7 @@ uid=uid, filename=filename) as cache_f: - preview_path = await images.resizeImage( + preview_path = await image.resize( path, new_size=report['recommended_size'], dest=cache_f