Questions tagged [gm]

Use this tag for questions regarding usages of the gm library for node.js

gm, and for node.js, is a node.js library that can execute native commands for image processing.

119 questions
1
vote
0 answers

Resizing hundreds of JPG's using node and gm

I've got an image folder with about 100 sub-folders and in each there are about 5 JPGs. I'm trying to use node to loop through all the images and resize them so the smallest dimension is 1200. They are a mix of portrait and landscape and the…
Nick Middleweek
  • 1,049
  • 2
  • 11
  • 19
1
vote
1 answer

Strange node.js + http + gm + s3 behavior

The purpose of this node.js code block is to download an image, resize it, upload the resized image to s3, and then upload the original image to s3. Non-Working code: http.get(url, function onResponse(res) { gm(res) .resize(250,250) …
Jack
  • 51
  • 6
1
vote
2 answers

Get info of applied image manipulation

I am using gm for node. I would like know the equivalent Javascript of the ImageMagick CLI command: convert /path/to/source.png -format "%@" info:- This will output the trim data, resulting in something like: 2672x3579+1115+725 I initially assumed…
Colin Meinke
  • 173
  • 1
  • 1
  • 7
1
vote
0 answers

how to achieve the following effect in imagemagick

I am trying to get sketch effect and i have the imagemagick command line code as follows convert 1.jpg -colorspace gray ( +clone -blur 0x8 \) +swap -compose divide -composite -linear-stretch 2%x20% cousincs.jpg I am using gm module and I tried…
ayniam
  • 573
  • 2
  • 8
  • 27
1
vote
0 answers

gm library react/webpack issues

I'm trying to use this package gm from node that also require that I require fs on the top. It was giving me some error but I fix it adding this configuration to my webpack.config file: node: { fs: "empty", child_process: "empty" } After…
thoer metn
  • 61
  • 2
1
vote
2 answers

Can I chain commands together with gm for node.js?

Can I chain two or more commands together when using gm, the GraphicsMagick library for node? Specifically, I've got an image that I'd like to add text to, then put a watermark on it, but nothing I try seems to work. I've tried using…
Grayda
  • 1,870
  • 2
  • 25
  • 43
1
vote
0 answers

NodeJs - graphicsMagic writes empty images

I'm resizing an image using gm library but it create an empty image. I use different ways for writing result but everytime get empty image. gm(readStream) .size({bufferStream: true}, function(err, size) { this.resize(100, 100, '%') …
Ali Amini
  • 172
  • 2
  • 14
1
vote
0 answers

Get progress when piping through gm

On my node app I'm trying to figure out how to see the progress of the stream. How can I get tell the browser what the progress is? This is the code I'm using on the server: gm(readStream, 'img.jpg') .resize(width, height) .quality(quality) …
Michael Seltenreich
  • 3,013
  • 2
  • 29
  • 55
1
vote
0 answers

Why is not gm's method 'toBuffer' promisified?

I tried to use gm to resize a big avatar image to 64 * 64. The express function is an async function and I tried to promisify all methods by the following codes: import gm_origin from 'gm' import Promise from 'bluebird'; const gm =…
Colin Wang
  • 6,778
  • 5
  • 26
  • 42
1
vote
1 answer

Meteor cfs:graphicsmagick transformWrite Error write eof at errnoException

Please help with this error, use cfs:graphicsmagick for Fs.Store.GridFS, I have this code.. Avatar = new FS.Collection("avatar", { stores: [new FS.Store.GridFS("avatar", { transformWrite: function (fileObj, readStream, writeStream) { …
1
vote
0 answers

Replace white space in png image on transparent background

operator('Opacity', 'Assign', Math.round( (1 - opacity) * 100 ) + '%') This command from the gm library for node replaces the whole picture. How I can replace only space with white color on the image with this lib?
John
  • 21
  • 3
1
vote
1 answer

When is an image uploading completion using multer?

I'm using multer.js on my project for user profile image uploading when user registration. I need to store user image file and to make thumbnail image also. When make thumbnail, I'm using gm.js. Belows are my codes. import { Router } from…
Benjamin
  • 707
  • 3
  • 8
  • 28
1
vote
0 answers

no decode delegate for this image format `'

I get strange error when I use gm package. I work with Windows x86. Already I installed gm, also imagemagick. This is my code: function convert(response, next) { console.time("convertImage"); console.log("Reponse content type…
Rougher
  • 834
  • 5
  • 19
  • 46
1
vote
1 answer

Amazon Lambda function merge multiple s3 images and put to a destination bucket

I was working on a lambda function which will be triggered via the amazon rest api. I have created the following a POST end point on REST API console a lambda function linked to the REST API Now as a first try I created the function such that it…
Abhik Chakraborty
  • 44,654
  • 6
  • 52
  • 63
0
votes
0 answers

Creating an image with gm and uploading to S3, v3

Many moons ago I made a tiny Lambda in NodeJS 8.x which created a PNG file to display a bunch of generated text and uploaded to S3 using s3.upload and it worked fine. I now want to transition to NodeJS 18.x and the v3 AWS SDK, but it seems…