Ad full image
This commit is contained in:
parent
ffc17d5a34
commit
b15a15afbc
|
@ -44,22 +44,24 @@ class CompressJob {
|
|||
{
|
||||
[ $width, $height ] = getimagesize($this->fullPath);
|
||||
|
||||
Storage::disk($this->disk)->makeDirectory($this->attachment->path);
|
||||
|
||||
if ($width > $this->maxFilesize) {
|
||||
$r = Resizer::open($this->fullPath);
|
||||
$r->resize($this->maxFilesize, 0);
|
||||
$r->save($this->fullPath);
|
||||
}
|
||||
|
||||
[ $width, $height ] = getimagesize($this->fullPath);
|
||||
$r = Resizer::open($this->fullPath);
|
||||
$r->save(Storage::disk($this->disk)->path($this->attachment->getVersionPath('full')));
|
||||
|
||||
Storage::disk($this->disk)->makeDirectory($this->attachment->path);
|
||||
[ $width, $height ] = getimagesize($this->fullPath);
|
||||
|
||||
foreach ($this->sizes as $w) {
|
||||
if ($width < $w) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Storage::disk($this->disk)->makeDirectory($this->attachment->path);
|
||||
|
||||
$r = Resizer::open($this->fullPath);
|
||||
$r->resize($w, 0);
|
||||
|
|
|
@ -59,7 +59,7 @@ class Attachment extends Model
|
|||
$ext = preg_quote($this->source->extension, '/');
|
||||
$name = preg_quote($this->slug, '/');
|
||||
|
||||
return "/^{$path}\/{$name}(-[0-9]+)?\.{$ext}$/";
|
||||
return "/^{$path}\/{$name}(-[0-9]+)?(-full)?\.{$ext}$/";
|
||||
}
|
||||
|
||||
public function getUrlAttribute() {
|
||||
|
|
Loading…
Reference in New Issue