Skip to content

Commit d17a395

Browse files
committed
fix: salvataggio allegati
1 parent 8428b0a commit d17a395

4 files changed

Lines changed: 5 additions & 20 deletions

File tree

modules/interventi/actions.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -971,9 +971,7 @@
971971
// Salvataggio firma
972972
$data = explode(',', post('firma_base64'));
973973
$img = getImageManager()->read(base64_decode($data[1]));
974-
$img->resize(680, 202, function ($constraint) {
975-
$constraint->aspectRatio();
976-
});
974+
$img->scaleDown(680, 202);
977975

978976
if (setting('Sistema di firma') == 'Tavoletta Wacom') {
979977
$img->brightness((float) setting('Luminosità firma Wacom'));
@@ -1068,9 +1066,7 @@
10681066
// Salvataggio firma
10691067
$data = explode(',', post('firma_base64'));
10701068
$img = getImageManager()->read(base64_decode($data[1]));
1071-
$img->resize(680, 202, function ($constraint) {
1072-
$constraint->aspectRatio();
1073-
});
1069+
$img->scaleDown(680, 202);
10741070
$encoded_image = $img->toJpeg();
10751071
$file_content = $encoded_image->toString();
10761072

src/API/App/v1/Interventi.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,7 @@ protected function salvaFirma($firma_base64, $id_intervento)
373373
{
374374
$data = explode(',', (string) $firma_base64);
375375
$img = getImageManager()->read(base64_decode($data[1]));
376-
$img->resize(680, 202, function ($constraint) {
377-
$constraint->aspectRatio();
378-
});
379-
380-
if (setting('Sistema di firma') == 'Tavoletta Wacom') {
381-
$img->brightness((float) setting('Luminosità firma Wacom'));
382-
$img->contrast((float) setting('Contrasto firma Wacom'));
383-
}
376+
$img->scaleDown(680, 202);
384377
$encoded_image = $img->toJpeg();
385378
$file_content = $encoded_image->toString();
386379

src/Models/Upload.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,7 @@ protected static function generateThumbnails($upload)
589589

590590
$img = getImageManager()->read($filepath);
591591

592-
$img->resize(600, null, function ($constraint) {
593-
$constraint->aspectRatio();
594-
});
592+
$img->scaleDown(600, null);
595593
$img->save(slashes($directory.'/'.$info['filename'].'_thumb600.'.$info['extension']));
596594

597595
$img->scale(250, null);

src/Models/User.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ public function setPhotoAttribute($value)
171171
$file = base_dir().'/files/temp_photo.'.$info['extension'];
172172

173173
// Ridimensionamento
174-
$img = getImageManager()->read($filepath)->resize(100, 100, function ($constraint) {
175-
$constraint->aspectRatio();
176-
});
174+
$img = getImageManager()->read($filepath)->scaleDown(100, 100);
177175
$img->save(slashes($file));
178176

179177
// Aggiunta nuova foto

0 commit comments

Comments
 (0)