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

Add libvips #365

Open
uuf6429 opened this issue Jun 8, 2023 · 2 comments
Open

Add libvips #365

uuf6429 opened this issue Jun 8, 2023 · 2 comments
Labels
enhancement requested New feature suggested

Comments

@uuf6429
Copy link

uuf6429 commented Jun 8, 2023

I'm using libvips inside PHP over ext-ffi. The docker image already supports enabling FFI, however of course libvips is missing.

At the moment I'm enabling it with the following inside my docker-compose file:

    environment:
      STARTUP_COMMAND_1: sudo apt-get update && sudo apt-get install -y libvips

..but it would be nicer to have it by default in the 'fat' image.


For some context on the whole story, check https://stackoverflow.com/q/76416455/314056.

@mistraloz mistraloz added the enhancement requested New feature suggested label Jun 9, 2023
@mistraloz
Copy link
Collaborator

I can't take your request for instance but i keep it in the enchancement list for instance.
Also, probably we will not implement custom extention (like libvips) for the fat images (we have to limit the size of the images). But we may imagine another command instead of "startup_command" (something like "init_command" to be run only at the first boot of the container).

PS: Personally, I looked for several options for image comparison and fell back on OpenCV through a python wrapper (not perfect for maintainability but very efficient : the only complexity is to save the image in filesystem, so i got some delay related and i had to implement lof of cache feature to limit that). I'm very curious about libvips capabilities.

@uuf6429
Copy link
Author

uuf6429 commented Jun 9, 2023

But we may imagine another command instead of "startup_command" (something like "init_command" to be run only at the first boot of the container).

The biggest problem (which is also totally not your fault) is that either way installation through apt-get is relatively slow because we always need to update(the indexes) first, and then there's also extra package dependencies. I've also had trouble in the past with apt-get in pipelines - from time to time their update services breaks (for a whole day, for example), causing us to be stuck until it's fixed.

In cases like this, the best solution is either a pre-built image or custom docker image.
(I'm not trying to convince you, just stating the facts.)

Personally, I looked for several options for image comparison and fell back on OpenCV through a python wrapper

I was considering taking that approach by building a native php library in rust connecting to OpenCV.
But in either case there are a lot of dependencies: rust+php-dev+opencv or php+python+opencv - plus, apparently opencv is quite heavy on dependencies itself (I had some minor trouble installing it in brew).

On the other hand, libvips was easier to set up: installing libvips, installing composer package, ensuring php has ffi enabled, done.
Additionally, the code I got from their forum almost worked perfectly the first try and it felt incredibly fast.

That's just my personal experience.

keep it in the enchancement list for instance.

Fine with me! 👍

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

No branches or pull requests

2 participants