You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
options.m2 [number ](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) the level of sharpening to apply to "jagged" areas. (optional, default 2.0)
When you searched for similar issues, what did you find that might be related?
I cannot find anywhere where this is clearly defined. 0 - 10,000 seems to be in the codebase, but this does not seem right from the example usage in the unit tests.
functionsharpen(options,flat,jagged){if(!is.defined(options)){// No arguments: default to mild sharpenthis.options.sharpenSigma=-1;}elseif(is.bool(options)){// Deprecated boolean argument: apply mild sharpen?this.options.sharpenSigma=options ? -1 : 0;}elseif(is.number(options)&&is.inRange(options,0.01,10000)){// Deprecated numeric argument: specific sigmathis.options.sharpenSigma=options;// Deprecated control over flat areasif(is.defined(flat)){if(is.number(flat)&&is.inRange(flat,0,10000)){this.options.sharpenM1=flat;}else{throwis.invalidParameterError('flat','number between 0 and 10000',flat);}}// Deprecated control over jagged areasif(is.defined(jagged)){if(is.number(jagged)&&is.inRange(jagged,0,10000)){this.options.sharpenM2=jagged;}else{throwis.invalidParameterError('jagged','number between 0 and 10000',jagged);}}}
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
Unit test use very low non-integer numbers:
it('specific radius 3 (sigma 1.5) and levels 0.5, 2.5',function(done){sharp(fixtures.inputJpg).resize(320,240).sharpen(1.5,0.5,2.5).toBuffer(function(err,data,info){if(err)throwerr;assert.strictEqual('jpeg',info.format);assert.strictEqual(320,info.width);assert.strictEqual(240,info.height);fixtures.assertSimilar(fixtures.expected('sharpen-3-0.5-2.5.jpg'),data,done);});});
what value range should I be providing in my use case of:
Does your scenario require the existing, equally-arbitrary 10000 limit in sharp to be increased to match that of libvips?
I recommend the use of named parameters when calling sharpen(), i.e. provide explicit m1 and m2 properties as part of a single options Object. (The unit tests quoted here exists to test a now-deprecated approach.)
Question about an existing feature
What are you trying to achieve?
What is the range of values allowed for sharpen?
options.m2 [number ](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) the level of sharpening to apply to "jagged" areas. (optional, default 2.0)
When you searched for similar issues, what did you find that might be related?
I cannot find anywhere where this is clearly defined. 0 - 10,000 seems to be in the codebase, but this does not seem right from the example usage in the unit tests.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
Unit test use very low non-integer numbers:
what value range should I be providing in my use case of:
currently I accept a sharpenLevel of 0 - 100, is this right?
The text was updated successfully, but these errors were encountered: