mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1485 Middle size images not preserve ratio
This commit is contained in:
parent
022b01398e
commit
3a11b5cf3f
@ -117,13 +117,13 @@ return [
|
||||
'picture_width' => [
|
||||
'type' => 'anomaly.field_type.integer',
|
||||
'config' => [
|
||||
'default_value' => 900,
|
||||
'default_value' => 600,
|
||||
],
|
||||
],
|
||||
'picture_height' => [
|
||||
'type' => 'anomaly.field_type.integer',
|
||||
'config' => [
|
||||
'default_value' => 600,
|
||||
'default_value' => 400,
|
||||
],
|
||||
],
|
||||
'watermark_type' => [
|
||||
|
||||
@ -60,22 +60,23 @@ class UploadController extends AdminController
|
||||
$watermarktype = $settings->value('visiosoft.module.advs::watermark_type');
|
||||
$position = $settings->value('visiosoft.module.advs::watermark_position');
|
||||
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath())
|
||||
->resize(
|
||||
setting_value('visiosoft.field_type.media::imageResizeW', null),
|
||||
setting_value('visiosoft.field_type.media::imageResizeH', 600)
|
||||
)
|
||||
->resizeCanvas(
|
||||
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
|
||||
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
|
||||
'center',
|
||||
false,
|
||||
'fff'
|
||||
);
|
||||
->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(
|
||||
setting_value('visiosoft.module.advs::picture_width'),
|
||||
setting_value('visiosoft.module.advs::picture_height')
|
||||
);
|
||||
->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'
|
||||
);
|
||||
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