Skip to content

Commit eb10166

Browse files
committed
Fix variable reference in background image size calculation
1 parent 76d832d commit eb10166

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Renderer/AbstractRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ protected function _background_image(string $url, float $x, float $y, float $wid
527527
}
528528

529529
if ($img_w != $org_img_w || $img_h != $org_img_h) {
530-
$imgBytes = $img_h * $img_h * 4 * 4; // 4 channels with 4 bytes per channel (e.g. truecolor with alpha)
530+
$imgBytes = $img_w * $img_h * 4 * 4; // 4 channels with 4 bytes per channel (e.g. truecolor with alpha)
531531
if ($maxImageBytes > 0 && ($imgBytes === null || $imgBytes > $maxImageBytes)) {
532532
Helpers::record_warnings(E_USER_WARNING, "Background image is too large to be rendered (calculated size: " . round($imgBytes / 1048576, 2) . " MB).", __FILE__, __LINE__);
533533
if (PHP_MAJOR_VERSION < 8) {

0 commit comments

Comments
 (0)