SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: realnc on December 03, 2009, 04:03:51 PM

Title: SP does not respect "width" attribute of img tag
Post by: realnc on December 03, 2009, 04:03:51 PM
SimplePortal 2.3.1
SMF 2.0 RC2

There is a problem with posts appearing on the portal front page that contain images that use "width" to limit the size of the image. For example, if the post specifies "width=220" in the img tag, SP rewrites this into "width=300" (by looking at the generated HTML the browser receives), breaking the intended layout of the poster.

I'm not sure if this has anything to do with the modifications I made to the img tag in Subs.php to support the "align", "hspace" and "vspace" attributes:

Code: [Select]
array(
         'tag' => 'img',
         'type' => 'unparsed_content',
         'parameters' => array(
                 'align' => array('optional' => true, 'value' => ' align="$1"', 'match' => '(left|right|middle|top|bottom)'),
                 'hspace' => array('optional' => true, 'value' => ' hspace="$1"', 'match' => '(\d+)'),
                 'vspace' => array('optional' => true, 'value' => ' vspace="$1"', 'match' => '(\d+)'),
                 'alt' => array('optional' => true),
                 'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
                 'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
         ),
         'content' => '<img src="$1" alt="{alt}"{width}{height}{align}{vspace}{hspace} class="bbc_img" />',
         'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
         'disabled_content' => '($1)',
 ),
Title: Re: SP does not respect "width" attribute of img tag
Post by: Nathaniel on February 10, 2010, 07:23:34 PM
I can't replicate this issue, could you please post a link to your website?
Title: Re: SP does not respect "width" attribute of img tag
Post by: realnc on February 11, 2010, 06:17:22 AM
It doesn't seem to happen always. Here's a post where it does happen.

Forum post: http://foss.math.aegean.gr/~realnc/forum/index.php/topic,8022.0.html

Portal: http://foss.math.aegean.gr/~realnc/forum/index.php?sa=news;start=5
Title: Re: SP does not respect "width" attribute of img tag
Post by: [SiNaN] on March 10, 2010, 05:59:18 AM
Does this still happen when you use style="height: xx; width: xx;" instead of width and height attributes for img tag?
Title: Re: SP does not respect "width" attribute of img tag
Post by: [SiNaN] on March 30, 2010, 06:09:43 AM
Any updates realnc?

Okay, I see what you mean. However, I'm unable to reproduce the issue.

I have made a post with an image and set its width as 50 in the img tag. SP resizer didn't override it though.
SimplePortal 2.3.8 © 2008-2024, SimplePortal