graphicsmagick

Magick++ not linking in OS X 10.8

冷暖自知 提交于 2019-12-11 05:36:38
问题 I am getting this error when I try to link my application with ImageMagick++. Undefined symbols for architecture x86_64: "Magick::Image::read(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: ... I am using the latest OSX SDK (10.8)... and compiling to x86_64 My library was compiled this way: ./configure --disable-osx-universal-binary --without-perl --enable-shared --disable-static --without-pango --with-magick-plus-plus --with

Node gm - use crop and resize cause error

筅森魡賤 提交于 2019-12-11 05:26:08
问题 The following code throw an error. Error: Command failed: gm convert: geometry does not contain image (unable to crop image). var gm = require('gm'); gm('/origin.jpg') .resize(600) .write('/beforeCrop', function (err) { // beforeCrop is 600 * 450 gm('/beforeCrop') .crop(70, 70, 100, 100) .resize(50, 50) .write('/result', function (err) { if (err) throw err; }); }); Is seem that gm can not resolve the size of beforeCrop . 回答1: Why not piping to a stream and reading from it on the fly? var gm =

How do I create a new image with [node] graphicsmagick using toBuffer

余生长醉 提交于 2019-12-10 21:16:27
问题 I'm trying to create a new image which will eventually be insert into a mongo database via gridfs. I'd prefer to avoid writing anything to the filesystem so the best route seems to create a new image, write the result to a buffer, then insert the buffer into the database. Unfortunately, the toBuffer method doesn't work for new images: var gm = require( 'gm' ); gm(200, 200, '#000F') .setFormat('png') .fill('black') .drawCircle( 50, 50, 60, 60 ) .toBuffer( 'PNG', function( error, buffer ) { if(

Using GraphicsMagick in Unity3D

大憨熊 提交于 2019-12-10 17:56:13
问题 I'm looking for an alternative to using the System.Drawing in Unity3D, since apparently Unity doesn't support it. I'd like to simply draw some lines on a texture. But I want options such as line width and edge rounding, which are fairly complex. GraphicsMagick seemed perfect, plus it's free. So here's the steps I've already taken: 1) I changed my playersettings to use api compatability level 2.0, not "subset". 2) I downloaded GraphicsMagick .Net 2.0 x64 wrapper, extracted the dll. 3) Right

Graphicsmagick: How to draw text to fit a specific box (width/height)

我只是一个虾纸丫 提交于 2019-12-10 13:16:38
问题 I'm using GraphicsMagick's node.js module. In my Node JS application I need to add a text label to an existing image, such that: 1) If the text is longer than the image size, the text auto-wraps around to the next line 2) If the text is not able to fit into the image, the font size of the text is automatically adjusted (reduced) to fit into the box of the image The available APIs from GraphicsMagick's node.js module are: gm("img.png").drawText(x, y, text [, gravity]) But this does not provide

Installing rmagick 2.13.1 with graphicsmagick on Ubuntu 10.04

≡放荡痞女 提交于 2019-12-10 12:32:50
问题 I previously had an rmagick gem installation that works with ImageMagick. ImageMagick was installed from source with OpenMP disabled. This installation works without a hitch. However I attempted to uninstall rmagick and ImageMagick so that I could have a version that works with GraphicsMagick. So I installed GraphicsMagick from source and disabled OpenMP feature once again. However, When I install rmagick I get the following: Building native extensions. This could take a while... ERROR: Error

How can I extract the first frame of a GIF and save it as a PNG using GraphicsMagick on NodeJS?

浪子不回头ぞ 提交于 2019-12-10 11:32:56
问题 Here are the steps in which I want to do this: The user gives the server a link to an animated gif The server uses "request(url)" to retrieve the file The server generates a thumbnail of the gif's first frame The server uploads the thumbnail to Amazon S3 The problem exists in Step 3. I can't figure out a way to extract the gif's first frame. I would prefer to use GraphicsMagick but if there is another way you know of that works, I would be most grateful! NodeJS is being used. 回答1: I don't

Resize and compose two or more images using gm in Nodejs

懵懂的女人 提交于 2019-12-10 10:08:06
问题 Given two images, say under img (in size of 1024x768) folder (img1.png and img2.png), I need to resize img2 (say 300x300) and put on img1 in x and y (say 100, 200) from top left of img1. The end result should be 1024x768 size image. Using gm (https://github.com/aheckmann/gm), tried this: gm('./img/img1.png') .composite('./img/img2.png') .geometry('300x300+100+200') .write('resultGM.png', (err) => { if (err) console.log(err); }); Expectedly (because of chain on whole operation) it produces

GraphicsMagick: toBuffer() Stream yields empty buffer

别等时光非礼了梦想. 提交于 2019-12-09 07:58:55
问题 I am trying to read a file into a buffer, resize it and then write it to disk using the following example code: function processImage(data) { gm(data, 'test.jpg') .resize('300x300') .background('white') .flatten() .setFormat('jpg') .toBuffer(function(err, buffer) { if (err) { throw err; } else { fs.writeFile('asd.jpg', buffer); } }); } However, this generates an error Error: Stream yields empty buffer . I have played around, used imageMagick and graphicsMagick, still the same. If i substitute

gm stream stdout pipe throwing unhandled error

情到浓时终转凉″ 提交于 2019-12-08 13:49:30
I am trying to take an image url get the image then write it to the filesystem then resize it. At the end of the resizing I would like to return it back to the response so the client gets the image. Right now the stdout.pipe(res) is not returning and I get an events.js:72 error: throw er; // Unhandled 'error' event. Am I missing anything obvious? exports.getImage = function(req, res, next) { var fileId = Math.uuid(); var i = request.get(req.params.image).pipe(fs.createWriteStream(fileId)); i.on('close', function () { gm(fileId) .resize('200', '200') .stream(function (err, stdout, stderr) { if