Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug determining SVG dimensions in SMF\Graphics\Image #8331

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Graphics/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,16 +959,16 @@ protected function getSvgDimensions(): void
$vb_height = $matches[3];

// No dimensions given, so use viewBox dimensions.
if (!empty($width) && !empty($height)) {
if (!isset($width) && !isset($height)) {
$width = $vb_width;
$height = $vb_height;
}
// Width but no height, so calculate height.
elseif (!empty($width)) {
elseif (isset($width)) {
$height = $width * $vb_height / $vb_width;
}
// Height but no width, so calculate width.
elseif (!empty($height)) {
elseif (isset($height)) {
$width = $height * $vb_width / $vb_height;
}
}
Expand Down
Loading