webflow-image-resizer

    1.1.0 • Public • Published

    webflow-image-resizer

    Build Status

    about

    Resize images in the WebFlow CMS based on predefined size in your collection image help fields. Format for help field sizing "300x300" supports 1 - 4 digit numbers (see example picture below).

    Images will be scaled down to fit the smallest constraint, with priority given to width. For example stating with an image 1300x860 and help text of 400x400, the result would be an image of 400x265.

    Image fields without help text or images that already meet the sizing requirements will be ignored by image-resizer.

    Supported types: jpeg, png, bmp, tiff, gif

    size-example

    How to install

    $ npm i --save webflow-image-resizer

    Required env variables

    In order to be able to persist the exported images in S3, you have to export these env variables:

    • AWS_ACCESS_KEY_ID Access key ID
    • AWS_SECRET_ACCESS_KEY Secret access key

    How to use

    var WebflowImageResizer = require('webflow-image-resizer')
    var resizer = new WebflowImageResizer(
        {
            aws: {
                region: 'eu-west-1',
                bucket: 'examplebucket'
            },
            webflow: {
                token: 'example-webflow-token'
            },
            quality: 90  //quality of image asa percentage
        }
    );
     
    resizer.onResizeSite('yourSiteIdHere')

    Install

    npm i webflow-image-resizer

    DownloadsWeekly Downloads

    2

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    26.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • expertlead
    • lmdoc