diff options
| author | Albert Krewinkel <[email protected]> | 2024-01-17 12:19:20 +0100 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-04-16 10:23:08 -0700 |
| commit | 5f937eae617d72f5f01e24f5a72bafc5b04fde15 (patch) | |
| tree | 99a21e079e428b93561e12a45ecc6a0961cc5f09 /doc | |
| parent | 9a09c89636e78edaed52276a2b3e00fb7368631b (diff) | |
Lua: add new module `pandoc.image`
The module provides basic querying functions for image properties.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lua-filters.md | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index e1504ff13..3872e1cba 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -4607,6 +4607,67 @@ Returns: <!-- END: AUTOGENERATED CONTENT --> +<!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.image --> + +# Module pandoc.image + +Basic image querying functions. + +## Functions {#pandoc.image-functions} + +### size {#pandoc.image.size} + +`size (image[, opts])` + +Returns a table containing the size and resolution of an image; +throws an error if the given string is not an image, or if the +size of the image cannot be determined. + +The resulting table has four entires: *width*, *height*, +*dpi_horz*, and *dpi_vert*. + +The `opts` parameter, when given, should be either a WriterOptions +object such as `PANDOC_WRITER_OPTIONS`, or a table with a `dpi` +entry. It affects the calculation for vector image formats such as +SVG. + +Parameters: + +`image` +: image data (string) + +`opts` +: writer options ([WriterOptions]\|table) + +Returns: + +- image size information or error message (table) + +*Since: 3.1.13* + +### format {#pandoc.image.format} + +`format (image)` + +Returns the format of an image as a lowercase string. + +Formats recognized by pandoc include *png*, *gif*, *tiff*, *jpeg*, +*pdf*, *svg*, *eps*, and *emf*. + +Parameters: + +`image` +: binary image data (string) + +Returns: + +- image format, or nil if the format cannot be determined + (string\|nil) + +*Since: 3.1.13* + +<!-- END: AUTOGENERATED CONTENT --> + <!-- BEGIN: AUTOGENERATED CONTENT for module pandoc.json --> # Module pandoc.json |
