class ProcessNewImageChunk extendsJob implementsShouldQueue

Traits

InteractsWithQueue
Queueable
Dispatchable

Properties

Collection $ids IDs of the images to generate thumbnails for.
protectedint $width The desired thumbnail width.
protectedint $height The desired thumbnail height.
protectedint $threshold If the image dimensions exceed this threshold the imag eshould be tiled.
protectedarray $needsThumbnailCache Caches if an image needs a new thumbnail.
protectedarray $needsMetadataCache Caches if an image needs a check for metadata.

Methods

void
__construct(Collection$ids)

Create a new job instance.

void
handle()

Execute the job.

bool
needsProcessing(Image$image)

Determine if an image needs to be processed.

bool
needsThumbnail(Image$image)

Chack if an image needs a thumbnail.

makeThumbnail(Image$image,string$path)

Makes a thumbnail for a single image.

bool
needsMetadata(Image$image)

Chack if an image has missing metadata.

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.

Details

at line73
void __construct(Collection$ids)

Create a new job instance.

Parameters

Collection $ids IDs oth the images to generate thumbnails for.

Return Value

void

at line85
void handle()

Execute the job.

Return Value

void

at line133
protectedbool needsProcessing(Image$image)

Determine if an image needs to be processed.

Parameters

Image $image

Return Value

bool

at line145
protectedbool needsThumbnail(Image$image)

Chack if an image needs a thumbnail.

Parameters

Image $image

Return Value

bool

at line164
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 line192
protectedbool needsMetadata(Image$image)

Chack if an image has missing metadata.

Parameters

Image $image

Return Value

bool

at line214
protected collectMetadata(Image$image,string$path)

Collect image metadata.

Parameters

Image $image
string $path Path to the cached image file.

at line295
protectedbool hasTakenAtInfo(array$exif)

Check if an exif array contains a creation date.

Parameters

array $exif

Return Value

bool

at line306
protectedbool hasGpsInfo(array$exif)

Check if an exif array contains GPS information.

Parameters

array $exif

Return Value

bool

at line320
protectedbool hasExtendedGpsInfo(array$exif)

Check if an exif array contains even more GPS information.

Parameters

array $exif

Return Value

bool

at line333
protectedarray|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 line352
protectedfloat 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 line369
protectedfloat fracToFloat(string$frac)

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

Parameters

string $frac

Return Value

float

at line395
protectedbool shouldBeTiled(Image$image)

Determine if an image should be tiled.

Parameters

Image $image

Return Value

bool