Skip to main content

Image converter for Foliant.

Project description

ImgConvert

ImgConvert is a tool to convert images from an arbitrary format into PNG.

Installation

$ pip install foliantcontrib.imgconvert

Config

To enable the preprocessor, add imgconvert to preprocessors section in the project config:

preprocessors:
    - imgconvert

The preprocessor has a number of options with the following default values:

preprocessors:
    - imgconvert:
        convert_path: convert
        cache_dir: !path .imgconvertcache
        image_width: 0
        formats: {}

convert_path : Path to convert binary. By default, it is assumed that you have this command in PATH. ImageMagick must be installed.

cache_dir : Directory to store processed images. They may be reused later.

image_width : Width of PNG images in pixels. By default (in case when the value is 0), the width of each image is set by ImageMagick automatically. Default behavior is recommended. If the width is given explicitly, file size may increase.

formats : Settings that apply to each format of source images.

The formats option may be used to define lists of targets for each format. If targets for a format are not specified explicitly, the preprocessor will be applied to all targets.

Example:

formats:
    eps:
        targets:
            - site
    svg:
        targets:
            - docx

Formats should be named in lowercase.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foliantcontrib.imgconvert-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file foliantcontrib.imgconvert-1.0.0.tar.gz.

File metadata

  • Download URL: foliantcontrib.imgconvert-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for foliantcontrib.imgconvert-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c76bf38895f641424ebf49e9b09c631a99b70f0cf1785927e950b4f1c692dca
MD5 acf47e790f96c84cfad5b69b924b5b4e
BLAKE2b-256 58c8380ee27b589a3dce2bfaf03fa45f5ab3d642c0c1f27c402bd4ea99281352

See more details on using hashes here.

File details

Details for the file foliantcontrib.imgconvert-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.imgconvert-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for foliantcontrib.imgconvert-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c42d97e4cb8a52e9b23e630d5e24b4289f6a7f23a23ace33a171388ea4adf9f8
MD5 000ac0d322e2130ca2c128937dffbc68
BLAKE2b-256 ea42f71950e1e71ed3c09b1ef1c04aa85a3188ef6bb863ae0808a7c0d7df8269

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page