Skip to content

Commit 7602510

Browse files
authored
Merge pull request #116 from BigKev73/patch-28
Update functions.image.php
2 parents 6c616ec + 21d9bfb commit 7602510

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

include/functions.image.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@ function newbbAttachmentImage($source)
7272
|| $imginfo[1] > $GLOBALS['xoopsModuleConfig']['max_image_height']) {
7373
$pseudo_width = $GLOBALS['xoopsModuleConfig']['max_image_width'];
7474
$pseudo_height = $GLOBALS['xoopsModuleConfig']['max_image_width'] * ($imginfo[1] / $imginfo[0]);
75-
$pseudo_size = "width='" . $pseudo_width . "px'";
75+
$pseudo_size = "width='" . $pseudo_width . "' height='" . $pseudo_height ."'";
7676
}
7777
// irmtfan to fix Undefined variable: pseudo_height
7878
if (!empty($pseudo_height) && $GLOBALS['xoopsModuleConfig']['max_image_height'] > 0
7979
&& $pseudo_height > $GLOBALS['xoopsModuleConfig']['max_image_height']) {
8080
$pseudo_height = $GLOBALS['xoopsModuleConfig']['max_image_height'];
8181
$pseudo_width = $GLOBALS['xoopsModuleConfig']['max_image_height'] * ($imginfo[0] / $imginfo[1]);
82-
$pseudo_size = "width='" . $pseudo_width . "px'";
82+
$pseudo_size = "width='" . $pseudo_width . "' height='" . $pseudo_height ."'";
8383
}
8484

8585
//BigKev73 Change to add max with property to properly scale photos
8686
if (file_exists($thumb)) {
8787
$attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
88-
$attachmentImage .= '<img src="' . $thumb_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" style="max-width: 100%" >';
88+
$attachmentImage .= '<img src="' . $thumb_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" style="max-width: 100%; height: auto;">';
8989
$attachmentImage .= '</a>';
9090
} elseif (!empty($pseudo_size)) {
9191
$attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
92-
$attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" style="max-width: 100%" >';
92+
$attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" style="max-width: 100%; height: auto;">';
9393
$attachmentImage .= '</a>';
9494
} elseif (file_exists($image)) {
95-
$attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '" style="max-width: 100%" >';
95+
$attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '" width="' . $imginfo[0] . '" height="' . $imginfo[1] . '" style="max-width: 100%; height: auto;">';
9696
} else {
9797
$attachmentImage = '';
9898
}

0 commit comments

Comments
 (0)