Merge pull request #397 from openclassify/vedat

add image canvas and resize in settings
This commit is contained in:
Fatih Alp 2020-03-09 17:41:41 +03:00 committed by GitHub
commit cb396ed5a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,30 @@
<?php
return [
'imageCanvasW' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 800,
],
],
'imageCanvasH' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'imageResizeW' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => null,
],
],
'imageResizeH' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
];

View File

@ -1,7 +1,7 @@
<?php
return [
'title' => 'Files',
'title' => 'Media Field Type',
'name' => 'Files Field Type',
'description' => 'A multiple files upload field type.',
];

View File

@ -0,0 +1,16 @@
<?php
return [
'imageCanvasW' => [
'name' => 'Image Canvas Width'
],
'imageCanvasH' => [
'name' => 'Image Canvas Height'
],
'imageResizeW' => [
'name' => 'Image Resize Width'
],
'imageResizeH' => [
'name' => 'Image Resize Height'
],
];

View File

@ -1,7 +1,7 @@
<?php
return [
'title' => 'Dosyalar',
'title' => 'Media Field Type',
'name' => 'Dosya Alanı Tipi',
'description' => 'Birden fazla dosya yükleme alanı türü.',
];

View File

@ -61,8 +61,8 @@ class UploadController extends AdminController
$position = $settings->value('visiosoft.module.advs::watermark_position');
$img = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, 600)
->resizeCanvas(800, 600, 'center', false, 'fff');
->resize(setting_value('visiosoft.field_type.media::setting.imageResizeW', null), setting_value('visiosoft.field_type.media::setting.imageResizeH', 600))
->resizeCanvas(setting_value('visiosoft.field_type.media::setting.imageCanvasW', 800), setting_value('visiosoft.field_type.media::setting.imageCanvasH', 600), 'center', false, 'fff');
if ($watermarktype == 'image') {
$watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image');