class GenerateAnnotationPatch extendsJob implementsShouldQueue

Traits

InteractsWithQueue
Queueable
Dispatchable

Properties

protectedstring $annotationClass The class of the annotation model.
protectedint $annotationId The ID of the annotation model.
protectedAnnotation $annotation The the annotation to generate a patch for.
protectedstring $targetDisk The storage disk to store the annotation patches to.

Methods

void
__construct(Annotation$annotation,string|null$targetDisk =null)

Create a new job instance.

void
handle()

Execute the job.

handleImage(Image$image,string$path)

Handle a single image.

Image
getVipsImage(string$path)

Get the vips image instance.

array
getPatchRect(Annotation$annotation,int$thumbWidth,int$thumbHeight)

Calculate the bounding rectangle of the patch to extract.

array
makeRectContained(array$rect,Image$image)

Adjust the position and size of the patch rectangle so it is contained in the image.

string
getTargetPath(Annotation$annotation)

Assemble the target path for an annotation patch.

bool
shouldRetryAfterException(Exception$e)

Determine if this job should retry instead of fail after an exception

Details

at line57
void __construct(Annotation$annotation,string|null$targetDisk =null)

Create a new job instance.

Parameters

Annotation $annotation The the annotation to generate a patch for.
string|null $targetDisk The storage disk to store the annotation patches to.

Return Value

void

at line72
void handle()

Execute the job.

Return Value

void

at line97
handleImage(Image$image,string$path)

Handle a single image.

Parameters

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

at line133
protectedImage getVipsImage(string$path)

Get the vips image instance.

Parameters

string $path

Return Value

Image

at line147
protectedarray getPatchRect(Annotation$annotation,int$thumbWidth,int$thumbHeight)

Calculate the bounding rectangle of the patch to extract.

Parameters

Annotation $annotation
int $thumbWidth
int $thumbHeight

Return Value

array Containing width, height, top and left

at line240
protectedarray makeRectContained(array$rect,Image$image)

Adjust the position and size of the patch rectangle so it is contained in the image.

Parameters

array $rect
Image $image

Return Value

array

at line262
protectedstring getTargetPath(Annotation$annotation)

Assemble the target path for an annotation patch.

Parameters

Annotation $annotation

Return Value

string

at line277
protectedbool shouldRetryAfterException(Exception$e)

Determine if this job should retry instead of fail after an exception

Parameters

Exception $e

Return Value

bool