Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

All feel good, why the difference between the last step? #190

Closed
wspnet opened this issue Jul 17, 2016 · 1 comment
Closed

All feel good, why the difference between the last step? #190

wspnet opened this issue Jul 17, 2016 · 1 comment

Comments

@wspnet
Copy link

wspnet commented Jul 17, 2016

http://localhost:48118/resize/Data/qibuchina/upload/image/001.jpg

public async Task<IActionResult> Index(string imagePath= "Data/qibuchina/upload/image/001.jpg", int maxWidth=387, int maxHeight=516)

All feel good, why the difference between the last step?

An unhandled exception occurred while processing the request.

Exception: Call to Node module failed with error: Error: Invalid width (1 to 16383) image/jpeg
at Sharp.resize (F:\Qibu\src\Qibu.Web\Node\node_modules\sharp\index.js:847:13)
at module.exports (F:\Qibu\src\Qibu.Web\Node\resizeImage.js:6:10)
at C:\Users\weisp\AppData\Local\Temp\tmp9D81.tmp:108:19
at IncomingMessage. (C:\Users\weisp\AppData\Local\Temp\tmp9D81.tmp:127:35)
at emitNone (events.js:67:13)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:921:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
MoveNext

Stack Query Cookies Headers
Exception: Call to Node module failed with error: Error: Invalid width (1 to 16383) image/jpeg at Sharp.resize (F:\Qibu\src\Qibu.Web\Node\node_modules\sharp\index.js:847:13) at module.exports (F:\Qibu\src\Qibu.Web\Node\resizeImage.js:6:10) at C:\Users\weisp\AppData\Local\Temp\tmp9D81.tmp:108:19 at IncomingMessage. (C:\Users\weisp\AppData\Local\Temp\tmp9D81.tmp:127:35) at emitNone (events.js:67:13) at IncomingMessage.emit (events.js:166:7) at endReadableNT (_stream_readable.js:921:12) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17)

@SteveSandersonMS
Copy link
Member

From the error message:

Error: Invalid width (1 to 16383) image/jpeg at Sharp.resize

... it looks like the value you're passing for "width" is the string "image/jpeg". Of course, it should be a number, not a string :)

Check the .NET code that's calling InvokeAsync and the parameters it's passing, and make sure it matches up with your Node code that's receiving these parameters. My guess is that you're trying to send a different number of parameters than you're receiving, or you're trying to receive them in a different order than they were sent.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants