added watermark size and opacity to app setting

pull/44/head
A1Gard 6 months ago
parent 7467fbd7fe
commit 061784523b

@ -61,8 +61,8 @@ MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
MEDIA_GALLEY_THUMB=500x500
MEDIA_POST_THUMB=500x500
MEDIA_WATERMARK_SIZE=15
MEDIA_WATERMARK_OPACITY=50
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

@ -69,7 +69,9 @@ class CategoryController extends XController
if (getSetting('watermark2')) {
$i->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
15, Unit::Percent, 15, Unit::Percent, Fit::Contain, 50);
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/categories/optimized-'. $category->$key);
}
@ -83,7 +85,9 @@ class CategoryController extends XController
if (getSetting('watermark2')) {
$i->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
15, Unit::Percent, 15, Unit::Percent, Fit::Contain, 50);
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/categories/optimized-'. $category->$key);
}

@ -68,7 +68,9 @@ class GroupController extends XController
if (getSetting('watermark2')) {
$i->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
15, Unit::Percent, 15, Unit::Percent, Fit::Contain, 50);
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/groups/optimized-'. $group->$key);
}
@ -82,7 +84,9 @@ class GroupController extends XController
if (getSetting('watermark2')) {
$i->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
15, Unit::Percent, 15, Unit::Percent, Fit::Contain, 50);
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/groups/optimized-'. $group->$key);
}

@ -70,7 +70,9 @@ class SliderController extends XController
if (getSetting('watermark2')) {
$i->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
15, Unit::Percent, 15, Unit::Percent, Fit::Contain, 50);
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/sliders/optimized-'. $slider->image);
}

@ -38,8 +38,10 @@ class Gallery extends Model implements HasMedia
->format(getSetting('optimize'));
if (getSetting('watermark')){
$mc->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft,5,5,Unit::Percent,
15,Unit::Percent,15,Unit::Percent,Fit::Contain,50);
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
// ->withResponsiveImages();

@ -41,8 +41,10 @@ class Image extends Model implements HasMedia
if (getSetting('watermark')){
$mc->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft,5,5,Unit::Percent,
15,Unit::Percent,15,Unit::Percent,Fit::Contain,50);
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
// ->watermark(public_path('images/logo.png'))->watermarkOpacity(50);
// ->withResponsiveImages();

@ -54,8 +54,10 @@ class Post extends Model implements HasMedia
if (getSetting('watermark')){
$mc->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft,5,5,Unit::Percent,
15,Unit::Percent,15,Unit::Percent,Fit::Contain,50);
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
}

@ -75,12 +75,16 @@ class Product extends Model implements HasMedia
if (getSetting('watermark')){
$mc->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft,5,5,Unit::Percent,
15,Unit::Percent,15,Unit::Percent,Fit::Contain,50);
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
$mc2->watermark(public_path('upload/images/logo.png'),
AlignPosition::BottomLeft,5,5,Unit::Percent,
15,Unit::Percent,15,Unit::Percent,Fit::Contain,50);
AlignPosition::BottomLeft, 5, 5, Unit::Percent,
config('app.media.watermark_size'), Unit::Percent,
config('app.media.watermark_size'), Unit::Percent, Fit::Contain,
config('app.media.watermark_opacity'));
}
}

@ -149,6 +149,8 @@ return [
'post_thumb' => env('MEDIA_POST_THUMB','500x500'),
'product_thumb' => env('MEDIA_PRODUCT_THUMB','500x500'),
'product_image' => env('MEDIA_PRODUCT_IMAGE','1200x1200'),
'watermark_size' => env('MEDIA_WATERMARK_SIZE',15),
'watermark_opacity' => env('MEDIA_WATERMARK_OPACITY',50),
],

Loading…
Cancel
Save