mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
9 lines
314 B
JavaScript
9 lines
314 B
JavaScript
var sharp = require('sharp');
|
|
|
|
module.exports = function(result, physicalPath, mimeType, maxWidth, maxHeight) {
|
|
// Invoke the 'sharp' NPM module, and have it pipe the resulting image data back to .NET
|
|
sharp(physicalPath)
|
|
.resize(maxWidth || null, maxHeight || null)
|
|
.pipe(result.stream);
|
|
}
|