core: image convertion + SVG support:

/!\ new optional dependency: CairoSVG (with installed `[SVG]` extra)

- new `convert` method in `tools.image` to save an image in an other format, with support
  for SVG (when CairoSVG is available)
- new `imageConvert` method is available for frontends
This commit is contained in:
Goffi 2020-04-19 16:53:44 +02:00
commit 47ec15cc46

View file

@ -1009,3 +1009,18 @@ doc=Generate a preview of an image in cache
doc_param_0=image_path: path of the original image
doc_param_1=%(doc_profile_key)s
doc_return=path to the preview in cache
[imageConvert]
async=
type=method
category=core
sig_in=ssss
sig_out=s
doc=Convert an image to an other format
doc_param_0=source: path of the image to convert
doc_param_1=dest: path to the location where the new image must be stored.
Empty string to generate a file in cache, unique to the source
doc_param_3=extra: serialised extra
doc_param_4=profile_key: either profile_key or empty string to use common cache
this parameter is used only when dest is empty
doc_return=path to the new converted image