gulp-responsive icon indicating copy to clipboard operation
gulp-responsive copied to clipboard

Error: image.max is not a function

Open retan opened this issue 5 years ago • 2 comments

Usage of max configuration option causes an error image.max is not a function. From what I can tell the error comes from sharp, and occurs because the max function was deprecated - see: https://sharp.pixelplumbing.com/changelog#v0210---4supthsup-october-2018

[15:39:56] Error in plugin "gulp-responsive"
Message:
    File `xxx.jpg`: image.max is not a function
Details:
    domainEmitter: [object Object]
    domainThrown: false

Stack:
    at DestroyableTransform.through2Handler [as _transform] (D:\...\node_modules\gulp-responsive\lib\index.js:98:14)

retan avatar Feb 16 '20 15:02 retan

Since this project seems to be inactive, even just for the moment (https://github.com/mahnunchik/gulp-responsive/issues/111), I've gone ahead and created a completely new plugin for this purpose on my own: https://github.com/robinloeffel/gulp-rezzy. It uses sharp under the hood, as well.

robinloeffel avatar Feb 18 '20 12:02 robinloeffel

Sharp max function is deprecated. Instead we need to use the Sharp fit param. I made a pull request that add the fit param to gulp-responsive config : #146

seb-celinedesign avatar Jun 06 '20 18:06 seb-celinedesign