Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The vips text action is missing #3

Open
Nakilon opened this issue Apr 9, 2020 · 6 comments
Open

The vips text action is missing #3

Nakilon opened this issue Apr 9, 2020 · 6 comments

Comments

@Nakilon
Copy link
Contributor

Nakilon commented Apr 9, 2020

$ vips -v && vips text | head -3
vips-8.9.1-Tue Jan 28 13:05:46 UTC 2020
make a text image
usage:
   text out text [--option-name option-value ...]
$ vips -l | grep Create -A 5
    VipsCreate (create), create operations
      VipsBlack (black), make a black image
      VipsGaussnoise (gaussnoise), make a gaussnoise image
      VipsText (text), make a text image
      VipsXyz (xyz), make an image where pixel values are coordinates
      VipsGaussmat (gaussmat), make a gaussian image
$ docker run -it --rm vips-alpine sh -c "vips -v && vips text"
vips-8.9.1-Tue Jan 28 13:05:46 UTC 2020
vips: unknown action "text"
$ docker run -it --rm vips-alpine vips -l | grep Create -A 5
    VipsCreate (create), create operations
      VipsBlack (black), make a black image
      VipsGaussnoise (gaussnoise), make a gaussnoise image
      VipsXyz (xyz), make an image where pixel values are coordinates
      VipsGaussmat (gaussmat), make a gaussian image
      VipsLogmat (logmat), make a laplacian of gaussian image
@Nakilon
Copy link
Contributor Author

Nakilon commented Apr 9, 2020

https://github.com/jcupitt/docker-builds/blob/a440d14220eb7457217de752731b437e6a3caa58/ruby-vips-alpine/Dockerfile#L39 says I need gdk-pixbuf-dev but that does not seem to help.

In configure there is the line

text rendering with pangoft2:     no

maybe it is the library that is needed?

@Nakilon
Copy link
Contributor Author

Nakilon commented Apr 9, 2020

Seems like text rendering needs all of this: expat pango expat-dev pango-dev gdk-pixbuf-dev.

@Nakilon
Copy link
Contributor Author

Nakilon commented Apr 9, 2020

Oh...

image

Adding such thing as apk add terminus-font and providing --font Terminus does not fix it. And it does not appear in pango-list even after fc-cache -fv.

UPD: forget about squares -- I'll create an Issue about it in another place.

@Nakilon
Copy link
Contributor Author

Nakilon commented Apr 9, 2020

So looks like it needs only pango, pango-dev and msttcorefonts-installer and probably it can be done after a build. You may close this ticket whether you want or not to add it to your Dockerfile. In my case I will use a "minified, single-purpose" build for just this command:

RUN set -x -o pipefail \
    && wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \
    && apk add glib libpng orc pango \
    && apk add --virtual vips-dependencies \
    build-base libpng-dev orc-dev \
    pango-dev msttcorefonts-installer \
    && cd /tmp/vips-${VIPS_VERSION} \
    && ./configure --prefix=/usr \
                   --disable-static \
                   --disable-debug \
                   --disable-dependency-tracking \
                   --enable-silent-rules \
    && make -s install-strip \
    && update-ms-fonts \
    && cd $OLDPWD \
    && rm -rf /tmp/vips-${VIPS_VERSION} \
    && apk del --purge vips-dependencies \
    && rm -rf /var/cache/apk/*

@felixbuenemann
Copy link
Owner

Thanks for looking into it.

I'm too busy to update the image right now, but I'll try to look into it the next time I update the image.

@felixbuenemann
Copy link
Owner

@Nakilon I pushed a new image felixbuenemann/vips-alpine:8.9.2 which has been upgraded to alpine 3.12, vips 8.9.2 and added pango, heif and libimagequant libs.

I didn't add any fonts, so you would have to add a line to install them to your own Dockerfile:

FROM felixbuenemann/vips-alpine:8.9

RUN set -x \
  && apk add --no-cache msttcorefonts-installer \
  && update-ms-fonts \
  && fc-cache -f \
  && apk del --no-cache --purge msttcorefonts-installer

Since the installer and its dependencies are removed, this will only add about 8 MiB to your image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants