question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically use locally available version libfreeimage

See original GitHub issue

What would it take to make this package try to automatically use the pre-installed version of that library instead of downloading its own copy? (N.B. I realise that $IMAGEIO_FREEIMAGE_LIB may be set on the user environment to point to a common installation of the file, however, I’m looking for an automated solution.)

For example, in conda-forge, freeimage is currently available for installation (https://anaconda.org/conda-forge/freeimage, v3.18), in a variety of platforms. One of the issues I’m trying to improve is the support for different OS/architecture types. Specifically, I’d like to have support of OSX/arm64 (new M1 macs). This would be possible by setting $IMAGEIO_FREEIMAGE_LIB, however, this would be a little bit uglier from a packaging perspective. Moreover, not all packaging systems support this kind of strategy.

Furthermore, as of now, everytime a new combination of os/hardware is introduced, you must ensure that the binary is available remotely, on the freeimage repository, and then patch imageio to make it work for that new OS/arch combination. An auto-detection would allow one to benefit from the existing library if available w/o an extra effort.

Another side effect of this behaviour is that you need to have some sort of external directory in which we are caching the downloaded freeimage library. If no environment variable is set, multiple users (benefiting from a global imageio installation) will end up downloading multiple copies of this file. An auto-detect strategy would make this package a bit more “unmutable” after installation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kmiloscommented, Dec 9, 2021

For example, in conda-forge, freeimage is currently available for installation (https://anaconda.org/conda-forge/freeimage, v3.18), in a variety of platforms. One of the issues I’m trying to improve is the support for different OS/architecture types.

With conda (at least I tested on Windows), imageio will “automatically” use the installed freeimage library (it searches the known locations and shared library names). Not as elegant as you suggest, but seems to work for most known environments so far…

For example, with MSYS2 packages, the shared system library can also be detected (known location and filename), so freeimage is added as an optional dependency in the package manager and we removed the binary download scripts to avoid any problems.

0reactions
FirefoxMetzgercommented, Jan 13, 2022

@anjos Yep, see also https://github.com/imageio/imageio/issues/628#issuecomment-838470536 (and similar comments across issues). The idea is to eventually move the FreeImage backend into its own repo and make it a dependency that can be installed via pip install imageio[freeimage].

Read more comments on GitHub >

github_iconTop Results From Across the Web

imageio.plugins.freeimage.download() downloads wrong ...
Hello, I'm using python (3.9.2) on a Mac Mini M1 installed via conda as a ... Automatically use locally available version libfreeimage #706....
Read more >
Tutorial : Dependencies from source - Gazebo
Install dependencies from source on Ubuntu. This tutorial will go through the process of installing some of Gazebo's dependencies from source.
Read more >
Installation — COLMAP 3.8 documentation
To list the available COLMAP commands, run COLMAP.bat -h in the command shell ... is a Python build script that builds COLMAP and...
Read more >
TextureImporter error - Mac OS Monterey 12.6
Hey all, I've been trying to get my dev environment set up on my Mac per the instructions listed on the official MonoGame...
Read more >
NVIDIA CUDA Installation Guide for Linux
To use NVIDIA CUDA on your system, you will need the following installed: CUDA-capable GPU. A supported version of Linux with a gcc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found