graphicsmagick

how to pass image buffer data to gm in() GraphicsMagic

故事扮演 提交于 2019-12-03 22:07:43
var buf = require('fs').readFileSync('test.jpg'); gm().in('-page', '+0+0').in(buf,'test.jpg').write('output.jpg', function (err) { if (err) console.log(err); }) in this case i want to pass buffer data as input to the gm.in() method. Below is the link I'm referencing but in it, an image path is used as an input. I want to use buffer data as an input. How can I do this? Tile four images together using Node.js and GraphicsMagick Without modifying the source of GraphicsMagick itself, you can't. The gm module interacts with the GraphicsMagick program through the command line. The arguments you're

Graphicsmagick not working in Elastic Beanstalk with nodejs and S3

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using nodejs and graphicsmagick to process images with text, then streaming the final jpg to S3. Using postman, I was able to test this flow on my localhost and everything works fine. However, I'm having issues now that I moved it to Elastic Beanstalk. When I post to the endpoint, it uploads a blank file to S3 and there are no errors logged in EB. I think it has something to do with the software but am a bit stuck. Any advice appreciated! Thanks! Top file is from localhost, bottom file is from Elastic Beanstalk: http://cl.ly

Tile four images together using Node.js and GraphicsMagick

冷暖自知 提交于 2019-12-03 05:09:08
问题 I have four 256x256 px images: a.jpg, b.jpg, c.jpg and d.jpg. I would like to merge them together to produce 2x2 mosaic image. The resulting image should be also 256x256 px. Like this: +---+---+ | a | b | +---+---+ | c | d | +---+---+ Using plain GraphicsMagick and command line this can be done with gm convert -background black \ -page +0+0 a.jpg \ -page +256+0 b.jpg \ -page +0+256 c.jpg \ -page +256+256 d.jpg \ -minify \ -mosaic output.jpg But the problem is, how to do this using

Installing GraphicsMagick on Mac OS X 10.8

好久不见. 提交于 2019-12-03 01:59:53
问题 I am trying to install GraphicsMagick on Mountain Lion and having problems. I tried all the things that I could search for in blogs and other stackoverflow questions but nothing worked. So I have put the full stack of errors I get on each command. Please look and help me out. When I run brew install graphicsmagick I get this Warning: Could not link jpeg. Unlinking... Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local You can try

Pipe stream to graphicsmagick/imagemagick child process

眉间皱痕 提交于 2019-12-02 21:09:33
I am trying to pipe data from a stream into a child process. var gm = spawn( 'gm convert - -thumbnail 220x165^ -gravity center -extent 220x165 thumb.jpg' ); var rs = fs.createReadStream( 'cow.jpg' ); rs.pipe( gm.stdin ) Do I need to call end on gm for it to work? Also in my real code I am getting the stream from a database. Example of how to stream a request into imagemagick: var image = request.get(req.params.url); var size = req.params.size.split('x'); var args = ['-', '-thumbnail', req.params.size + '^', '-gravity', 'center', '-extent', req.params.size, '-' ]; var convert = spawn('convert',

spawn ENOENT error with NodeJS

 ̄綄美尐妖づ 提交于 2019-12-02 19:57:34
问题 I get an error using GM() on my remote server, I think i get an issue when I try to write the file... It works perfectly on my local server... My code : gm() .in('-page', '+0+0') .in('/var/www/myapp/public/images/instabox.jpg') .in('-page', '+10+10') .in(image) .mosaic() .minify() .write(newFileName, function (err) { // newfilename = '/var/www/myapp/public/uploads/mydir/image.jpg' if (!err) console.log('done'); if (err) console.log(err); callback(); }); My error : { [Error: spawn ENOENT] code

Tile four images together using Node.js and GraphicsMagick

℡╲_俬逩灬. 提交于 2019-12-02 18:24:33
I have four 256x256 px images: a.jpg, b.jpg, c.jpg and d.jpg. I would like to merge them together to produce 2x2 mosaic image. The resulting image should be also 256x256 px. Like this: +---+---+ | a | b | +---+---+ | c | d | +---+---+ Using plain GraphicsMagick and command line this can be done with gm convert -background black \ -page +0+0 a.jpg \ -page +256+0 b.jpg \ -page +0+256 c.jpg \ -page +256+256 d.jpg \ -minify \ -mosaic output.jpg But the problem is, how to do this using GraphicsMagick within Node.js ? gm('a.jpg') .append('b.jpg') .append('c.jpg') .append('d.jpg') .write('output.jpg'

JNI - Passing large amounts of data between Java and Native code

不问归期 提交于 2019-12-02 15:12:53
I am trying to achieve the following: 1) I have a byte array on the java side that represents an image. 2) I need to give my native code access to it. 3) The native code decodes this image using GraphicsMagick and creates a bunch of thumbnails by calling resize. It also calculates a perceptual hash of the image which is either a vector or a unint8_t array. 4) Once I return this data back to the Java side different threads will read it. The thumbnails will be uploaded to some external storage service via HTTP. My questions are: 1) What would be the most efficient way to pass the bytes from Java

What is the correct index position of the Convert command's options of GraphicsMagick

亡梦爱人 提交于 2019-12-02 14:01:10
问题 I am confused about the covert command of GraphicsMagick. According to the documentation (http://www.graphicsmagick.org/convert.html), the synopsis of convert command is: convert [ options ... ] input_file output_file According to the above synopsis, I can execute the convert command in the following way: Example 1: gm convert -strip -scale x400 inputFile.jpg outputFile.jpg The above command is executed successfully. Now, I ran the the same command with different index position of the options

GraphicsMagick的命令概览

≡放荡痞女 提交于 2019-12-01 13:24:19
GraphicsMagick 的命令概览 ---------------------------------------------------------------------------- [ convert | identify | mogrify | composite | montage | compare | display | animate | import | conjure ] convert:转换图像格式和大小,模糊, 裁剪 ,驱除污点,抖动,临近,图片上画图片,加入新图片,生成 缩略图 等。 identify:描述一个或较多图像文件的格式和特性。 mogrify:按规定尺寸***一个图像,模糊,裁剪,抖动等。Mogrify改写最初的图像文件然后写到一个不同的图像文件。 composite:根据一个图片或多个图片组合生成图片。 montage:创建一些分开的要素图像。在含有要素图像任意的装饰图片,如边框、结构、图片名称等。 compare:在算术上和视觉上评估不同的图片***其它的改造图片。 display:如果你拥有一个X server的系统,它可以按次序的显示图片 animate:利用X server显示动画图片 import:在X server或任何可见的窗口上输出图片文件。 你可以捕获单一窗口,整个的荧屏或任何荧屏的矩形部分。 conjure