class ProcessNewImage extends Job implements ShouldQueue

Traits

SerializesModels
InteractsWithQueue
Queueable
Dispatchable

Properties

int $tries

The number of times the job may be attempted.

protected bool $deleteWhenMissingModels

Ignore this job if the image does not exist any more.

Image $image

The image to process

protected int $width

The desired thumbnail width.

protected int $height

The desired thumbnail height.

protected int $threshold

If the image dimensions exceed this threshold the imag eshould be tiled.

Methods

void
__construct(Image $image)

Create a new job instance.

void
handle()

Execute the job.

makeThumbnail(Image $image, string $path)

Makes a thumbnail for a single image.

collectMetadata(Image $image, string $path)

Collect image metadata.

bool
hasTakenAtInfo(array $exif)

Check if an exif array contains a creation date.

bool
hasGpsInfo(array $exif)

Check if an exif array contains GPS information.

bool
hasExtendedGpsInfo(array $exif)

Check if an exif array contains even more GPS information.

array|bool
getExif(string $path)

Get the exif information of an image if possible.

float
getGps(array $exifCoord, string $hemi)

Converts a EXIF GPS coordinate to a float see: http://stackoverflow.com/a/2572991/1796523.

float
fracToFloat(string $frac)

Converts a fracture (string) like "1/2" to a float.

bool
shouldBeTiled(Image $image)

Determine if an image should be tiled.

submitTileJob(Image $image)

Submit a new tile job if the image needs tiling.

Details

at line 72
void __construct(Image $image)

Create a new job instance.

Parameters

Image $image

The image to generate process.

Return Value

void

at line 82
void handle()

Execute the job.

Return Value

void

at line 125
protected makeThumbnail(Image $image, string $path)

Makes a thumbnail for a single image.

Parameters

Image $image
string $path

Path to the cached image file.

at line 149
protected collectMetadata(Image $image, string $path)

Collect image metadata.

Parameters

Image $image
string $path

Path to the cached image file.

at line 220
protected bool hasTakenAtInfo(array $exif)

Check if an exif array contains a creation date.

Parameters

array $exif

Return Value

bool

at line 231
protected bool hasGpsInfo(array $exif)

Check if an exif array contains GPS information.

Parameters

array $exif

Return Value

bool

at line 245
protected bool hasExtendedGpsInfo(array $exif)

Check if an exif array contains even more GPS information.

Parameters

array $exif

Return Value

bool

at line 258
protected array|bool getExif(string $path)

Get the exif information of an image if possible.

Parameters

string $path

Path to the image file

Return Value

array|bool

at line 277
protected float getGps(array $exifCoord, string $hemi)

Converts a EXIF GPS coordinate to a float see: http://stackoverflow.com/a/2572991/1796523.

Parameters

array $exifCoord

Containing fractures like "41/1"

string $hemi

Hemisphere, one of N, S, E, or W

Return Value

float

at line 294
protected float fracToFloat(string $frac)

Converts a fracture (string) like "1/2" to a float.

Parameters

string $frac

Return Value

float

at line 320
protected bool shouldBeTiled(Image $image)

Determine if an image should be tiled.

Parameters

Image $image

Return Value

bool

at line 342
protected submitTileJob(Image $image)

Submit a new tile job if the image needs tiling.

Parameters

Image $image