GenerateAnnotationPatch
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
void
handle()
Execute the job.
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
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.
at line72
void
handle()
Execute the job.
at line97
handleImage(Image$image,string$path)
Handle a single image.
at line133
protectedImage
getVipsImage(string$path)
Get the vips image instance.
at line147
protectedarray
getPatchRect(Annotation$annotation,int$thumbWidth,int$thumbHeight)
Calculate the bounding rectangle of the patch to extract.
at line240
protectedarray
makeRectContained(array$rect,Image$image)
Adjust the position and size of the patch rectangle so it is contained in the image.
at line262
protectedstring
getTargetPath(Annotation$annotation)
Assemble the target path for an annotation patch.
at line277
protectedbool
shouldRetryAfterException(Exception$e)
Determine if this job should retry instead of fail after an exception