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

Unable to use Vix.Vips.Operation.pdfload/2 method in 0.16 version #92

Closed
aakashjhawar opened this issue Feb 15, 2023 · 3 comments
Closed

Comments

@aakashjhawar
Copy link

The newer 0.16 version of vix brings pre-compiled binaries but does not support Vix.Vips.Operation.pdfload/2 and Vix.Vips.Operation.pdfload_buffer/2 methods.

How do you recommend if we want to use these methods in the 0.16 version?

Also, if we use 0.15.1v of vix, we are facing the error which is already reported in this issue.

@akash-akya
Copy link
Owner

akash-akya commented Feb 15, 2023

Yes, the precompiled libvips only comes with most common formats targeting most common usecase.

How do you recommend if we want to use these methods in the 0.16 version?

You can skip using precompiled libvips and bring your own libvips library with support for formats you want by installing it manually using package manager. This was the default behavior before v0.16.0. To get this behavior in the newer versions set env VIX_COMPILATION_MODE=PLATFORM_PROVIDED_LIBVIPS. More details here -- https://github.com/akash-akya/vix#pre-compiled-nif-and-libvips. Let me know if you face any issue with this.

Also, if we use 0.15.1v of vix, we are facing the error which is already reported in this #77

Did you try the solution mentioned in that issue thread? libvips/php-vips#142 (comment)

@aakashjhawar
Copy link
Author

Hi @akash-akya, I tried installing libvips by following the steps mentioned here libvips/php-vips#142 (comment) and I'm using 0.15.1 version of vix.

However, I'm getting this error when I try load PDF. UndefinedFunctionError) function Vix.Vips.Operation.pdfload/2 is undefined or private.

Do you have any example of a Dockerfile where libvips is installed and you are able to use the Vips.Operation.pdfload/2 method?

@akash-akya
Copy link
Owner

akash-akya commented Feb 16, 2023

You have to add additional dependencies for PDF format support. Just installing libpoppler-glib-dev package should do it.
something like

RUN \
  apt-get update && \
  apt-get install -y \
    git \
    glib-2.0-dev \
    libexif-dev \
    libexpat-dev \
    libffi-dev \
    libjpeg-dev \
    libpoppler-glib-dev \ # install dependency
    liblcms2-dev \
    libpng-dev \
    libtiff-dev \
    meson \
    unzip \
    wget

Can you share the Dockerfile you used?
You can read more details about the different format support and dependecnies needed to support different formats here -- https://github.com/libvips/libvips#pdfium

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

No branches or pull requests

2 participants