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