We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 338-356 (lines=19) @@ | ||
| 335 | $variant_name = $new_file_name.'-'.$variant.$extension; |
|
| 336 | $variant_file = $destination_path.'/'.$variant_name; |
|
| 337 | ||
| 338 | if ($dimensions) { |
|
| 339 | $width = $dimensions[0]; |
|
| 340 | $height = $dimensions[1]; |
|
| 341 | ||
| 342 | if ($img->width() > $width || $img->height() > $height) { |
|
| 343 | $img->resize($width, $height, function ($constraint) { |
|
| 344 | $constraint->aspectRatio(); |
|
| 345 | }) |
|
| 346 | ->save($disk_root.'/'.$variant_file); |
|
| 347 | } else { |
|
| 348 | $img->save($disk_root.'/'.$variant_file); |
|
| 349 | } |
|
| 350 | ||
| 351 | $image_variations[$variant] = $public_path.'/'.$variant_file; |
|
| 352 | } else { |
|
| 353 | $img->save($disk_root.'/'.$variant_file); |
|
| 354 | $image_variations['original'] = $variant_file; |
|
| 355 | } |
|
| 356 | } |
|
| 357 | ||
| 358 | $this->attributes[$attribute_name] = $image_variations['original']; |
|
| 359 | } |
|
| @@ 280-297 (lines=18) @@ | ||
| 277 | $variant_name = $new_file_name.'-'.$variant.'.'.$file->getClientOriginalExtension(); |
|
| 278 | $variant_file = $destination_path.'/'.$variant_name; |
|
| 279 | ||
| 280 | if ($dimensions) { |
|
| 281 | $width = $dimensions[0]; |
|
| 282 | $height = $dimensions[1]; |
|
| 283 | ||
| 284 | if ($img->width() > $width || $img->height() > $height) { |
|
| 285 | $img->resize($width, $height, function ($constraint) { |
|
| 286 | $constraint->aspectRatio(); |
|
| 287 | }) |
|
| 288 | ->save($disk_root.'/'.$variant_file); |
|
| 289 | } else { |
|
| 290 | $img->save($disk_root.'/'.$variant_file); |
|
| 291 | } |
|
| 292 | ||
| 293 | $image_variations[$variant] = $public_path.'/'.$variant_file; |
|
| 294 | } else { |
|
| 295 | $image_variations['original'] = $public_path.'/'.$file_path; |
|
| 296 | } |
|
| 297 | } |
|
| 298 | } else { |
|
| 299 | $image_variations['original'] = $public_path.'/'.$file_path; |
|
| 300 | $image_variations['thumb'] = $public_path.'/'.$file_path; |
|