#877·gm

Does not overlay text on image with latest GraphicsMagick versions

Author: grisovCreated Jan 26, 2025Updated Jan 26, 2025

To overlay text on image I use the following code:

typescript
  import * as gmagick from "gm";

  const gm = gmagick.subClass({ imageMagick: false });

  gm(200, 200, "#ffaca2")
    .region(200, 200, 0, 0)
    .gravity("Center")
    .font("../fonts/OpenSans-Regular2.ttf", 22)
    .fill("#000000")
    .drawText(0, 0, "AB")
    .setFormat("png")
    .quality(4);

Operating system: Alpine Linux 3.21

bash
  apk add libwebp libwebp-tools freetype graphicsmagick

gm==1.25.0

The text is missing on image if installed GraphicsMagick == 1.3.43-1.3.45.

With older versions of GraphicsMagick up to 1.3.42, this code works correctly.