Photo scan and move implemented, and remove redundant files
This commit is contained in:
@@ -4,9 +4,12 @@ namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Traits\ForwardsCalls;
|
||||
use Imagick;
|
||||
|
||||
use App\Jobs\CatalogMove;
|
||||
|
||||
class Photo extends Abstracted\Catalog
|
||||
{
|
||||
use ForwardsCalls;
|
||||
@@ -28,11 +31,26 @@ class Photo extends Abstracted\Catalog
|
||||
|
||||
// How should the image be rotated, based on the value of orientation
|
||||
private array $_rotate = [
|
||||
3=>180,
|
||||
6=>90,
|
||||
8=>-90,
|
||||
3 => 180,
|
||||
6 => 90,
|
||||
8 => -90,
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
// Any photo saved, queue it to be moved.
|
||||
self::saved(function($item) {
|
||||
if ($item->scanned && (! $item->duplicate) && (! $item->remove) && ($x=$item->shouldMove()) === TRUE) {
|
||||
Log::info(sprintf('%s: Need to Move [%s]','Photo',$item->id.'|'.serialize($x)));
|
||||
|
||||
CatalogMove::dispatch($item)
|
||||
->onQueue('move');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the GPS coordinates
|
||||
*/
|
||||
|
Reference in New Issue
Block a user