Also bundle perl script

old-stable24
Varun Patil 2022-10-20 13:41:34 -07:00
parent 8c323f9581
commit dd1466066d
3 changed files with 20 additions and 6 deletions

View File

@ -10,4 +10,11 @@ wget "https://github.com/pulsejet/exiftool-bin/releases/download/$exifver/exifto
wget "https://github.com/pulsejet/exiftool-bin/releases/download/$exifver/exiftool-aarch64-musl"
wget "https://github.com/pulsejet/exiftool-bin/releases/download/$exifver/exiftool-aarch64-glibc"
chmod 755 *
wget "https://github.com/exiftool/exiftool/archive/refs/tags/$exifver.zip"
unzip "$exifver.zip"
mv "exiftool-$exifver" exiftool
rm -rf *.zip exiftool/t exiftool/html
chmod 755 exiftool/exiftool
cd ..

View File

@ -149,8 +149,8 @@ class Index extends Command
{
// Refuse to run without exiftool
if (!$this->testExif()) {
error_log('FATAL: exiftool could not be found or test failed');
error_log('Please install exiftool (at least v12) and make sure it is in the PATH');
error_log('FATAL: exiftool could not be executed or test failed');
error_log('Make sure you have perl 5 installed in PATH');
return 1;
}

View File

@ -399,7 +399,9 @@ class Exif
$noLocal = $config->getSystemValue($configKey.'_no_local', false);
// We know already where it is
if (!empty($configPath)) return $configPath;
if (!empty($configPath) && \file_exists($configPath)) {
return $configPath;
}
// Detect architecture
$arch = null;
@ -426,9 +428,6 @@ class Exif
// check if file exists
if (file_exists($path)) {
// make executable
chmod($path, 0755);
// check if the version prints correctly
$ver = self::EXIFTOOL_VER;
$vero = shell_exec("$path -ver");
@ -446,6 +445,14 @@ class Exif
}
}
// Fallback to perl script
$path = dirname(__FILE__) . "/../exiftool-bin/exiftool/exiftool";
if (file_exists($path)) {
return $path;
}
error_log("Exiftool not found: $path");
// Fallback to system binary
return 'exiftool';
}