mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Support streamed response from HttpNodeInstance
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
var sharp = require('sharp');
|
||||
|
||||
module.exports = function(cb, physicalPath, mimeType, maxWidth, maxHeight) {
|
||||
module.exports = function(result, physicalPath, mimeType, maxWidth, maxHeight) {
|
||||
sharp(physicalPath)
|
||||
.resize(maxWidth > 0 ? maxWidth : null, maxHeight > 0 ? maxHeight : null)
|
||||
.toBuffer(function (err, buffer) {
|
||||
cb(err, { base64: buffer && buffer.toString('base64') });
|
||||
});
|
||||
.pipe(result.stream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user