Skip to content

VIPSHOME misused/unsupported on Windows #232

Closed
@uuf6429

Description

@uuf6429
        $vipshome = getenv("VIPSHOME");
        if ($vipshome) {
            // lib<qual>/ predicates lib/
            $libraryPaths[] = $vipshome . ($is_64bits ? "/lib64/" : "/lib32/");
            // lib/ is always searched
            $libraryPaths[] = $vipshome . "/lib/";
        }

How should VIPSHOME be configured on Windows?

The Windows download contains a bin and a lib subdirectory, however the library itself (libvips-42.dll) is in the bin.

Assuming I downloaded the package to C:\vips,

  • when VIPSHOME=C:\vips, the library will be searched in C:\vips\lib - the path exists, but the library doesn't
  • when VIPSHOME=C:\vips\bin, the library will be searched in C:\vips\bin\lib, which doesn't exist

I see the following options:

  1. simply add VIPSHOME as a potential library location (without a platform check; might be useful to other platforms, not just Window):
          if ($vipshome) {
              $libraryPaths[] = $vipshome . '/';
              …
  2. make it support the Windows structure differently:
          if ($vipshome) {
              if (PHP_OS_FAMILY === "Windows") {
                  $libraryPaths[] = $vipshome . '/';
              } else {
                  // lib<qual>/ predicates lib/
                  $libraryPaths[] = $vipshome . ($is_64bits ? "/lib64/" : "/lib32/");
                  // lib/ is always searched
                  $libraryPaths[] = $vipshome . "/lib/";
              }
          }
  3. show an error on Windows:
          if ($vipshome) {
              if (PHP_OS_FAMILY === "Windows") {
                  throw new RuntimeException('VIPSHOME is not supported on Windows');
              }
              …

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions