Skip to content
This repository was archived by the owner on Jan 10, 2020. It is now read-only.

Update cms.php#198

Open
mattkatt wants to merge 1 commit into
GrafiteInc:masterfrom
mattkatt:patch-1
Open

Update cms.php#198
mattkatt wants to merge 1 commit into
GrafiteInc:masterfrom
mattkatt:patch-1

Conversation

@mattkatt
Copy link
Copy Markdown

@mattkatt mattkatt commented Jul 12, 2019

FileService.php, when saving images, looks for a declaration in config/cms of max-image-size, with a default to 800px:

//cms/src/Services/FileService.php
118    if ($isImage) {
119            $storage = Storage::disk(Config::get('cms.storage-location', 'local'));
120            $image = $storage->get($directory.$newFileName.'.'.$extension);
121    
122            $image = InterventionImage::make($image)->resize(config('cms.max-image-size', 800), null, function ($constraint) {
123                $constraint->aspectRatio();
124            });
125
126            $imageResized = $image->stream();
127    
128            $storage->delete($directory.$newFileName.'.'.$extension);
129            $storage->put($directory.$newFileName.'.'.$extension, $imageResized->__toString());
130        }

this config variable is not declared, and can be confusing if trying to upload hero_images larger than 800px. Propose adding the variable to the config/cms file by default

FileService.php, when saving images, looks for a declaration in config/cms of `max-image-size`, with a default to 800px:

```php
//cms/src/Services/FileService.php
118    if ($isImage) {
119                $storage = Storage::disk(Config::get('cms.storage-location', 'local'));
120                $image = $storage->get($directory.$newFileName.'.'.$extension);
121    
122                $image = InterventionImage::make($image)->resize(config('cms.max-image-size', 800), null, function ($constraint) {
123                    $constraint->aspectRatio();
124                });
125
126                $imageResized = $image->stream();
127    
128                $storage->delete($directory.$newFileName.'.'.$extension);
129                $storage->put($directory.$newFileName.'.'.$extension, $imageResized->__toString());
130            }
```

this config variable is not declared, and can be confusing if trying to upload hero_images larger than 800px. Propose adding the variable to the config/cms file by default
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant