Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
This repository was archived by the owner on May 1, 2025. It is now read-only.

Support for webp? #16

Description

@fcosrno

Any chance of quickly adding webp support? ImageMagick seems to allow webp (See here).

I tried the README example using webp:

var resize = require('im-resize');

var image = {
  path: 'cute-cat.jpg',
  width: 5184,
  height: 2623
};

var output = {
  versions: [{
    suffix: '-square',
    maxWidth: 200,
    aspect: "1:1",
    format:"webp"
  }]
};

resize(image, output, function(error, versions) {
  if (error) { console.error(error); }
  console.log(versions[0].path);   // /path/to/image-thumb.jpg
  console.log(versions[0].width);  // 150
  console.log(versions[0].height); // 100

  console.log(versions[1].path);   // /path/to/image-square.jpg
  console.log(versions[1].width);  // 200
  console.log(versions[1].height); // 200
});

But got the following error:

Error: Command failed: convert cute-cat.jpg -auto-orient -strip -write mpr:cute-cat.jpg +delete mpr:cute-cat.jpg -quality 80 -crop "2624x2623+1280+0" -resize "200" cute-cat-square.webp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions