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
0
votes
2 answers

How to fix nodejs gm(GraphicsMagicks) text display bold randomly

I use nodejs gm drawText function to add text to images based on coordinates. Everything is good except the text displayed in bold randomly (red border marked in the below image). I don't need to show text in bold. How to make all text display…
Evan
  • 191
  • 2
  • 15
0
votes
0 answers

GM .write not making file

enter image description here gm.write not making file The path file in the write of gm does not work, and there is still no response even if the path is changed, and no error is reported。I want to find this problem, but gm didn't report an error,…
0
votes
0 answers

Set fixed width to image with ImageMagic library

I'm trying to generate following image: this is my code. I'm using out command to set fix with to font: const gm = require("gm").subClass({ imageMagick: true }); gm(1800, 2400, "transparent") .fill("#ffffff") …
Lasharela
  • 1,307
  • 1
  • 11
  • 23
0
votes
0 answers

node.js gm write command giving me "Error: spawn ENOTDIR"

I'm trying to create a little script to resize images. But what ever i do, i get the Error: spawn ENOTDIR See the rwx file settings here: I have striped the code to this. And the error still occurs: const gm =…
Billy
  • 23
  • 4
0
votes
2 answers

How to efficiently convert a large pdf with many pages into individual (high-res) jpgs with node (in the backend) using (for example) graphicsmagick?

I would like to use node (in my backend) to convert a large PDF with many (hundreds!) of pages to individual jpgs to store them in a database for further purposes. For this I have chosen the npm package "gm" which uses "graphicsmagick" in the…
bassman21
  • 320
  • 2
  • 11
0
votes
1 answer

gm.py x64.release Errorr---env: python: No such file or directory

macos monterey 12.3.1 python -V: python3 which python3: /usr/local/bin/python3 alias python="/usr/bin/python3" path: /Users/Bill/Public/browser/depot_tools /usr/local/bin /usr/bin /bin /usr/sbin /sbin proxy: proxychains4 + tor socks5 127.0.0.1…
0
votes
0 answers

GraphicMagick PDF to jpeg black image in NodeJS

I'm trying to convert PDF images to jpeg thumbnails. Following is a sample code with GraphicMagick. const gm = require("gm"); const imageMagick = gm.subClass({ imageMagick: true }); image =…
Abhishek
  • 23
  • 4
0
votes
1 answer

How to get gif frames using Node GraphicsMagick/ImageMagick

How to get gif frames using node gm? Example on PHP $frames = new \Imagick( 'image.gif' )->coalesceImages(); https://github.com/aheckmann/gm
0
votes
1 answer

imagemagick gm node buffer file conversion

I'm currently using ImageMagick and gm to process images from a buffer. My problem is that I cannot control what file types are put in the buffer but wish to have everything turned to jpg. Not sure how to do that using the buffer since I'm not…
0
votes
1 answer

gm imagemagick passing in convert arguments as a string

I'm trying to pass the convert arguments as string to in() without success. works fine if I run this: const GM = require('gm'); const gm = GM.subClass({ imageMagick: true…
0
votes
0 answers

How to fix Error: Stream yields empty buffer in Node.js v14 + GM + ImageMagick

How to fix Error: Stream yields empty buffer in Node.js v14.15.3? Here is some code how I use ImageMagick to process images: const gm = require('gm').subClass({ imageMagick: true }); const resize = (imageStream, width, height) => new…
0
votes
0 answers

How to use gm convert to split a gif into multiple png files?

I want to split input.gif into the files output0.png through output15.png. Works perfectly fine in the terminal when I use this: convert -coalesce input.gif output%d.png But now I need to automate this across hundreds of files in specific folders…
0
votes
1 answer

How to resize an image but keep it's orientation and aspect ratio ? (gm)

I would like to resize an image to a maximum height of 400px, while keeping its orientation and aspect ratio. This resizes the image, but changes its orientation (if it is portrait it changes it to landscape). gm(file.stream) .resize('400')
Yaron
  • 1,655
  • 6
  • 20
  • 38
0
votes
1 answer

AWS node js lambda using gm imagemagick resize, crop and monochrome getting timeout

My lambda function watches s3, gets object and crops/resizes to desired sizes, then uploads. I do have the lambda layer for imagemagick, and I've had some success with resize, but it works maybe 10% of the time. These are my imagemagick…
Chase Fenske
  • 128
  • 7
0
votes
1 answer

gm/convert binaries can't be found Node.js pdf-to-image conversion

I am using https://www.npmjs.com/package/pdf2pic to convert my PDF to image. const PDF2Pic = require('pdf2pic'); const pdf2pic = new PDF2Pic({ density: 100, // output pixels per inch savename: 'untitled', // output file name savedir:…
Kartik Rawat
  • 244
  • 2
  • 7