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