Merge remote-tracking branch 'origin/exif_metadata'

# Conflicts:
#	public/mix-manifest.json
#	resources/js/App.vue
#	resources/js/components/FilesView/ImageMetaData.vue
#	resources/js/components/FilesView/InfoSidebar.vue
#	resources/js/components/FilesView/SearchBar.vue
#	resources/js/components/Spotlight/Spotlight.vue
#	resources/js/views/Shared.vue
#	src/Domain/Files/Resources/FileResource.php
This commit is contained in:
Čarodej
2022-02-25 18:23:08 +01:00
16 changed files with 358 additions and 143 deletions
+27 -1
View File
@@ -28,7 +28,6 @@ class FileResource extends JsonResource
'mimetype' => $this->mimetype,
'file_url' => $this->file_url,
'thumbnail' => $this->thumbnail,
'metadata' => $this->metadata,
'parent_id' => $this->parent_id,
'created_at' => set_time_by_user_timezone($this->owner, $this->created_at),
'updated_at' => set_time_by_user_timezone($this->owner, $this->updated_at),
@@ -64,6 +63,33 @@ class FileResource extends JsonResource
],
],
]),
$this->mergeWhen($this->exif, fn() => [
'exif' => [
'data' => [
'type' => 'exif',
'id' => $this->exif->id,
'attributes' => [
'date_time_original' => format_date($this->exif->date_time_original),
'artist' => $this->exif->artist,
'height' => $this->exif->height,
'width' => $this->exif->width,
'x_resolution' => substr($this->exif->x_resolution, 0, strrpos($this->exif->x_resolution, '/')),
'y_resolution' => substr($this->exif->y_resolution, 0, strrpos($this->exif->y_resolution, '/')),
'color_space' => $this->exif->color_space,
'camera' => $this->exif->camera,
'model' => $this->exif->model,
'aperture_value' => intval($this->exif->aperture_value) / 100,
'exposure_time' => $this->exif->exposure_time,
'focal_length' => $this->exif->focal_length,
'iso' => $this->exif->iso,
'aperture_f_number' => $this->exif->aperture_f_number,
'ccd_width' => $this->exif->ccd_width,
'longitude' => format_gps_coordinates($this->exif->longitude, $this->exif->longitude_ref),
'latitude' => format_gps_coordinates($this->exif->latitude, $this->exif->latitude_ref),
],
],
]
])
],
],
];