diff --git a/lib/Db/ExifFields.php b/lib/Db/ExifFields.php new file mode 100644 index 00000000..e5629f5d --- /dev/null +++ b/lib/Db/ExifFields.php @@ -0,0 +1,86 @@ + true, + 'CreateDate' => true, + 'OffsetTimeOriginal' => true, + 'OffsetTime' => true, + + // Generated date fields + 'DateTimeEpoch' => true, + 'LocationTZID' => true, + + // Camera Info + 'Make' => true, + 'Model' => true, + 'LensModel' => true, + 'CameraType' => true, + 'AutoRotate' => true, + 'SerialNumber' => true, + + // Photo Info + 'FNumber' => true, + 'ApertureValue' => true, + 'FocalLength' => true, + 'ISO' => true, + 'ShutterSpeedValue' => true, + 'ShutterSpeed' => true, + 'ExposureTime' => true, + 'WhiteBalance' => true, + 'Sharpness' => true, + 'ColorTemperature' => true, + 'HDR' => true, + 'HDREffect' => true, + 'ColorSpace' => true, + 'Aperture' => true, + 'ImageUniqueID' => true, + + // GPS info + 'GPSLatitude' => true, + 'GPSLongitude' => true, + 'GPSAltitude' => true, + 'GPSTimeStamp' => true, + 'GPSStatus' => true, + + // Size / rotation info + 'Megapixels' => true, + 'Rotation' => true, + 'Orientation' => true, + + // Editable Metadata + 'Title' => true, + 'Description' => true, + 'Label' => true, + 'Artist' => true, + 'Copyright' => true, + + // Other image info + 'Rating' => true, + 'NumberOfImages' => true, + 'FlashType' => true, + 'RedEyeReduction' => true, + 'CircleOfConfusion' => true, + 'DOF' => true, + 'FOV' => true, + + // Currently unused fields + 'ExifVersion' => true, + + // Video info + 'Duration' => true, + 'FrameRate' => true, + 'TrackDuration' => true, + 'VideoCodec' => true, + ]; +} diff --git a/lib/Db/TimelineWrite.php b/lib/Db/TimelineWrite.php index 82927c9d..b57be324 100644 --- a/lib/Db/TimelineWrite.php +++ b/lib/Db/TimelineWrite.php @@ -11,8 +11,6 @@ use OCP\Files\File; use OCP\IDBConnection; use OCP\Lock\ILockingProvider; -require_once __DIR__.'/../ExifFields.php'; - const DELETE_TABLES = ['memories', 'memories_livephoto', 'memories_places']; const TRUNCATE_TABLES = ['memories_mapclusters']; @@ -290,7 +288,7 @@ class TimelineWrite } // Only keep fields in the whitelist - if (\array_key_exists($key, EXIF_FIELDS_LIST)) { + if (\array_key_exists($key, ExifFields::EXIF_FIELDS_LIST)) { $filteredExif[$key] = $value; } } diff --git a/lib/ExifFields.php b/lib/ExifFields.php deleted file mode 100644 index a9f43423..00000000 --- a/lib/ExifFields.php +++ /dev/null @@ -1,81 +0,0 @@ - true, - 'CreateDate' => true, - 'OffsetTimeOriginal' => true, - 'OffsetTime' => true, - - // Generated date fields - 'DateTimeEpoch' => true, - 'LocationTZID' => true, - - // Camera Info - 'Make' => true, - 'Model' => true, - 'LensModel' => true, - 'CameraType' => true, - 'AutoRotate' => true, - 'SerialNumber' => true, - - // Photo Info - 'FNumber' => true, - 'ApertureValue' => true, - 'FocalLength' => true, - 'ISO' => true, - 'ShutterSpeedValue' => true, - 'ShutterSpeed' => true, - 'ExposureTime' => true, - 'WhiteBalance' => true, - 'Sharpness' => true, - 'ColorTemperature' => true, - 'HDR' => true, - 'HDREffect' => true, - 'ColorSpace' => true, - 'Aperture' => true, - 'ImageUniqueID' => true, - - // GPS info - 'GPSLatitude' => true, - 'GPSLongitude' => true, - 'GPSAltitude' => true, - 'GPSTimeStamp' => true, - 'GPSStatus' => true, - - // Size / rotation info - 'Megapixels' => true, - 'Rotation' => true, - 'Orientation' => true, - - // Editable Metadata - 'Title' => true, - 'Description' => true, - 'Label' => true, - 'Artist' => true, - 'Copyright' => true, - - // Other image info - 'Rating' => true, - 'NumberOfImages' => true, - 'FlashType' => true, - 'RedEyeReduction' => true, - 'CircleOfConfusion' => true, - 'DOF' => true, - 'FOV' => true, - - // Currently unused fields - 'ExifVersion' => true, - - // Video info - 'Duration' => true, - 'FrameRate' => true, - 'TrackDuration' => true, - 'VideoCodec' => true, -];