This commit is contained in:
Richard Dern
2022-01-12 00:35:37 +01:00
commit 400e3d01f1
1363 changed files with 57778 additions and 0 deletions

34
app/Analyzers/ExifAnalyzer.php Executable file
View File

@@ -0,0 +1,34 @@
<?php
namespace App\Analyzers;
/**
* Extract information from a supported image file.
*/
class ExifAnalyzer extends Analyzer
{
/**
* Analyzes document.
*/
public function analyze()
{
if (empty($this->body)) {
return;
}
$bodyPath = storage_path('app/'.$this->document->getStoragePath().'/body');
$this->details = exif_read_data($bodyPath, null, true, true);
if (empty($this->details)) {
return;
}
$this->document->description = (string) view('partials.details.image')->with([
'exif' => $this->details,
'url' => asset(str_replace('public', 'storage', $this->document->getStoragePath()).'/body'),
]);
$this->storeDetailsOnDisk();
$this->applyDetailsToDocument();
}
}