Tag: 缩略图

Azurefunction,缩略图图像大小比原始图像大

我已经使用这个背景图像缩略图处理与Azure函数和 NodeJS文章创build缩略图image.An图像创build成功,但图像的大小已经增加。怎么会发生? 它一定是非常小的没有? 我怎样才能解决这个奇怪的问题? 这是Blob存储上的原始图像 处理后(缩略图) 这是Azurefunction(节点): var Jimp = require("jimp"); module.exports = (context, myBlob) => { // Read image with Jimp Jimp.read(myBlob).then((image) => { // Manipulate image image .resize(200, Jimp.AUTO) .greyscale() .getBuffer(Jimp.MIME_JPEG, (error, stream) => { // Check for errors if (error) { context.log(`There was an error processing the image.`); context.done(error); } else { […]

设置缩略图图像内容types

我需要为缩略图图像设置Content-Type 。 我尝试过,如下图所示。但它不起作用。但是,它存储为一个stream。 天青function: index.json var Jimp = require("jimp"); module.exports = (context, myBlob) => { // Read image with Jimp Jimp.read(myBlob).then((image) => { // Manipulate image image .resize(200, Jimp.AUTO) .greyscale() .getBuffer(Jimp.MIME_JPEG, (error, stream) => { if (error) { context.log(`There was an error processing the image.`); context.done(error); } else { context.log(`Successfully processed the image`); stream.set("Content-Type", Jimp.MIME_JPEG); […]

fluent-ffmpeg缩略图创build错误

我尝试创build一个stream利的ffmpegvideo缩略图这里是我的代码 var ffmpeg = require('fluent-ffmpeg'); exports.thumbnail = function(){ var proc = new ffmpeg({ source: 'Video/express2.mp4',nolog: true }) .withSize('150×100') .takeScreenshots({ count: 1, timemarks: [ '00:00:02.000' ] }, 'Video/', function(err, filenames) { console.log(filenames); console.log('screenshots were saved'); }); } 但我不断收到这个错误 "mate data contains no duration, aborting screenshot creation" 任何想法为什么, 顺便说一下,在Windows上,我把ffmpeg文件夹放在c / ffmpeg中,而且我把ffmpeg / bin添加到了我的环境中,我不知道fluent-ffmpeg是否需要知道ffmpeg的path,但是我可以成功用下面的代码创build一个缩略图 exec("C:/ffmpeg/bin/ffmpeg -i Video/" + […]

如何在node.js中生成video缩略图?

我正在用node.js构build一个应用程序,我成功上传了video,但是我需要为它生成一个video缩略图,目前我使用node exec来执行ffmpeg的系统命令来制作缩略图 exec("C:/ffmpeg/bin/ffmpeg -i Video/" + Name + " -ss 00:01:00.00 -r 1 -an -vframes 1 -f mjpeg Video/" + Name + ".jpg") 这段代码来自http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-resumable-video-uploade-in-node-js/ 上面的代码生成了一个jpg文件,但它不是一个缩略图,但一个video屏幕截图,我不知道是否有任何其他方法来生成video缩略图,或如何执行ffmpeg命令做一个真正thumbanil(resize),我更喜欢PNG文件,请帮助!