mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2011 openclassify field type background change
This commit is contained in:
parent
92d4a89809
commit
b96ec7d8c0
@ -25,6 +25,7 @@ return [
|
||||
'estimated_pending_time',
|
||||
'default_published_time',
|
||||
'default_GET',
|
||||
'add_canvas',
|
||||
'thumbnail_width',
|
||||
'thumbnail_height',
|
||||
'picture_width',
|
||||
|
||||
@ -108,6 +108,13 @@ return [
|
||||
'default_value' => 270,
|
||||
],
|
||||
],
|
||||
'add_canvas' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => true,
|
||||
'mode' => 'checkbox',
|
||||
],
|
||||
],
|
||||
'thumbnail_height' => [
|
||||
'type' => 'anomaly.field_type.integer',
|
||||
'config' => [
|
||||
|
||||
@ -79,6 +79,9 @@ return [
|
||||
'default_GET' => [
|
||||
'name' => 'Default Ad GET',
|
||||
],
|
||||
'add_canvas' => [
|
||||
'name' => 'Add Canvas',
|
||||
],
|
||||
'thumbnail_width' => [
|
||||
'name' => 'Thumbnail Width',
|
||||
],
|
||||
|
||||
@ -316,9 +316,18 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
// Create thumbnail image
|
||||
$image = Image::make(file_get_contents($adv->files[0]->url()));
|
||||
$image->resize(
|
||||
setting_value('visiosoft.module.advs::thumbnail_width'),
|
||||
setting_value('visiosoft.module.advs::thumbnail_height')
|
||||
);
|
||||
null,
|
||||
setting_value('visiosoft.module.advs::thumbnail_height'),
|
||||
function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
if (setting_value('visiosoft.module.advs::add_canvas')) {
|
||||
$image->resizeCanvas(
|
||||
setting_value('visiosoft.module.advs::thumbnail_width'),
|
||||
setting_value('visiosoft.module.advs::thumbnail_height'),
|
||||
'center', false, 'fff'
|
||||
);
|
||||
}
|
||||
$fileName = 'tn-' . $adv->files[0]->name;
|
||||
$image->save(app_storage_path() . '/files-module/local/images/' . $fileName);
|
||||
|
||||
|
||||
@ -62,21 +62,23 @@ class UploadController extends AdminController
|
||||
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath())
|
||||
->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->resizeCanvas(
|
||||
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
|
||||
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
|
||||
'center', false, 'fff'
|
||||
);
|
||||
});
|
||||
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
|
||||
->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->resizeCanvas(
|
||||
setting_value('visiosoft.module.advs::picture_width', 400),
|
||||
setting_value('visiosoft.module.advs::picture_height', 300),
|
||||
'center', false, 'fff'
|
||||
);
|
||||
});
|
||||
if (setting_value('visiosoft.module.advs::add_canvas')) {
|
||||
$fullImg->resizeCanvas(
|
||||
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
|
||||
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
|
||||
'center', false, 'fff'
|
||||
);
|
||||
$mdImg->resizeCanvas(
|
||||
setting_value('visiosoft.module.advs::picture_width', 400),
|
||||
setting_value('visiosoft.module.advs::picture_height', 300),
|
||||
'center', false, 'fff'
|
||||
);
|
||||
}
|
||||
foreach ([$fullImg, $mdImg] as $index => $image) {
|
||||
if ($watermarktype == 'image') {
|
||||
$watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user