()
| 102 | } |
| 103 | |
| 104 | private toBufferWithImageMagick(): Buffer { |
| 105 | const magickArgs = ["-", "-resize", `${this.newWidth}x`, "-quality", `${this.jpegOptions.quality}`, `${this.newFormat}:-`]; |
| 106 | trace(`Running magick command: magick ${magickArgs.join(" ")}`); |
| 107 | |
| 108 | const proc = spawnSync("magick", magickArgs, { |
| 109 | maxBuffer: 8 * 1024 * 1024, |
| 110 | input: this.buffer |
| 111 | }); |
| 112 | |
| 113 | return proc.stdout; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | export class Image { |