Skip to content

Commit 87ea406

Browse files
committed
chore: Style and type
1 parent abfae1a commit 87ea406

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

samples/Sample_47_SVG.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
'width' => 200,
2323
'height' => 200,
2424
'align' => 'center',
25-
'wrappingStyle' => \PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_BEHIND,
25+
'wrappingStyle' => PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_BEHIND,
2626
]
2727
);
2828

29-
3029
function printSeparator(Section $section): void
3130
{
3231
$section->addTextBreak();

src/PhpWord/Element/Image.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ private function checkImage(): void
442442
$this->imageQuality = null;
443443
$this->memoryImage = false;
444444
$this->sourceType = self::SOURCE_LOCAL;
445-
// On dimensionne le style en EMU
446445
$this->setProportionalSize($actualWidth, $actualHeight);
447446

448447
return;
@@ -629,8 +628,8 @@ public function getSvgDimensions(string $file): array
629628
$svg = $dom->documentElement;
630629

631630
// 1) essai sur width/height
632-
$wAttr = round($svg->getAttribute('width'));
633-
$hAttr = round($svg->getAttribute('height'));
631+
$wAttr = round((float) $svg->getAttribute('width'));
632+
$hAttr = round((float) $svg->getAttribute('height'));
634633

635634

636635
$w = (int) filter_var($wAttr, FILTER_SANITIZE_NUMBER_INT);

0 commit comments

Comments
 (0)