exif: resume on failure to get file (fix #820)

Signed-off-by: Varun Patil <radialapps@gmail.com>
dexie
Varun Patil 2023-09-29 18:52:03 -07:00
parent fa9d26e3da
commit 23843c3ded
1 changed files with 8 additions and 2 deletions

View File

@ -68,9 +68,15 @@ class Exif
/**
* Get exif data as a JSON object from a Nextcloud file.
*/
public static function getExifFromFile(File &$file)
public static function getExifFromFile(File $file)
{
try {
$path = $file->getStorage()->getLocalFile($file->getInternalPath());
} catch (\Throwable $ex) {
// https://github.com/pulsejet/memories/issues/820
throw new \Exception('Failed to get local file: '.$ex->getMessage());
}
if (!\is_string($path)) {
throw new \Exception('Failed to get local file path');
}