diff --git a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php index b2cd5d67a..bab98b997 100644 --- a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php +++ b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php @@ -65,8 +65,11 @@ class UploadController extends AdminController $img = WaterMark::make($this->request->file('upload')->getRealPath()); $watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image'); $watermarkimage = $files->find($watermarkimage_id); + $w = $img->width(); if ($watermarkimage != null) { - $watermark = WaterMark::make(public_path() . '/app/default/files-module/local/' . $watermarkimage->path())->opacity(50); + $watermark = WaterMark::make(public_path() . '/app/default/files-module/local/' . $watermarkimage->path()) + ->opacity($settings->value('visiosoft.module.advs::watermark_opacity')) + ->resize($w); $img->insert($watermark, $position); } @@ -77,7 +80,7 @@ class UploadController extends AdminController $h = "center"; $w = $img->width() / 2; $h1 = $img->height() / 2; - $font_size = $w/20; + $font_size = $w / 20; $img->text($watermarktext, $w, $h1, function ($font) use ($v, $h, $font_size) { $font->file(public_path('Antonio-Bold.ttf')); $font->size($font_size); diff --git a/composer.json b/composer.json index 5cf2e15cc..a743a7240 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "anomaly/tags-field_type": "~2.3.0", "anomaly/slug-field_type": "~2.1.0", "anomaly/text-field_type": "~2.2.0", - "anomaly/file-field_type": "~2.2.32", + "anomaly/file-field_type": "2.2.32", "anomaly/url-field_type": "~2.2.0", "anomaly/configuration-module": "~2.1.0", "anomaly/preferences-module": "~2.1.0",