khalyomede / gulp-sharp-responsive

A gulp plugin to generate responsives images.
https://npmjs.com/package/gulp-sharp-responsive
17 stars 6 forks source link

Problew with creating placeholders. #9

Closed Ihornechypor closed 1 year ago

Ihornechypor commented 1 year ago

Hi, I am trying to create a placeholder that has a 5% of the width. But I got an error. image

Ihornechypor commented 1 year ago

ready :)

{ width: (metadata) => Math.trunc(metadata.width * 0.05) ? Math.trunc(metadata.width * 0.05) : 1, format: "webp", rename: { suffix: "-ph" }, webpOptions: config.webpOptions}, { width: (metadata) => metadata.width, format: "webp", rename: { suffix: "@2x" }, webpOptions: config.webpOptions}, { width: (metadata) => metadata.width, rename: { suffix: "@2x" }, pngOptions: config.pngOptions, jpegOptions: config.jpegOptions}, { width: (metadata) => Math.trunc(metadata.width * 0.5) ? Math.trunc(metadata.width * 0.5) : 1, format: "webp",webpOptions: config.webpOptions}, { width: (metadata) => Math.trunc(metadata.width * 0.5) ? Math.trunc(metadata.width * 0.5) : 1, pngOptions: config.pngOptions, jpegOptions: config.jpegOptions}