Jump to content

The way IP.Board scales down large images and its draw-backs


Guest .KX

Recommended Posts

Basically, this is a topic highlighting all of the problems that IP.Board's method of scaling down images has. Don't vote in the poll unless you have gone through this post, I want to get a general consensus of what people actually think and if you aren't going to read through this post, then this topic is pretty-much useless.

(1) When viewing a topic, which has large images within. Of course the images are scaled down, but they are not scaled down until the page has finished loading. The image will show full size until everything has loaded, then and only then will it scale down. This is a rather clumsy looking method, it isn't attractive (not in the least). You have a huge stretched layout, then suddenly it goes back to normal again, it just doesn't look right.

(2) This one is bad. O.k, let's say that we have a topic with 6 posts.

1st post - Has a scaled down image.


2nd post - Has no scaled down image.


3rd post - Has a scaled down image.


4th post - Has no scaled down image.


5th post - Has a scaled down image.


6th post - Has no scaled down image.



Basically, as you are scrolling down through the topic, as you are passing over the 1st, 3rd and 5th posts no matter how fast your connection/computer is or how good your graphics card is or even if you have "smooth" scrolling enabled, the scrolling will lag, HORRIBLY. It is not exactly a major issue, but an annoying one. It just makes it look even more ugly. (If you didn't understand that, then basically - as you pass over images that have been rescaled, the scrolling lags.)


They're basically the only issues I can think of about IP.Board's method of resizing large images, are they sufficient enough for it to be changed? Well you decide, vote in the poll.
Link to comment
Share on other sites

You do understand that this ONLY happens for LINKED images, and not images uploaded to the board right?

It's impossible to do it any other way, except for possibly downloading images off of remote servers when they are linked in posts, then thumbnailing them locally. What happens if someone changes the image they are remotely linking to? It won't update on your site, and that is not what the poster intended. Not to mention you now have to store (even if you don't allow attachments) all the remotely linked images on YOUR server. :blink:

You can disable the auto-resizing of remotely linked images if you choose (which would break your layout, as it does in every other version, if the image is large). Otherwise, you can only resize them after the page has loaded unfortunately. There's just no "better" way to do it.

Link to comment
Share on other sites

list($kw, $kh) = @getimagesize($url);
        //$kw => width
        //$kh => height
        
        $mw = 500;
        $mh = 250;
        //$mw => maximum width
        //$mh => maximum height
        
        if($kw > $mw && $kh < $mh)
        {
            return "<a href='".$url."' target='_blank'><img src='."$url."' border='0' width='".$mw."px' class='attach' /></a>";
        } 
        elseif($kw < $mw && $kh > $mh) 
        {
            return "<a href='".$url."' target='_blank'><img src='".$url."' border='0' height='".$mh."px' class='attach' /></a>";
        } 
        elseif($kw > $mw && $kh > $mh) 
        {
            if ($kw > $kh)
            {
                        return "<a href='".$url."' target='_blank'><img src='".$url."' border='0' width='".$mw."px' class='attach' /></a>";
            } 
            else 
            {
                        return "<a href='".$url."' target='_blank'><img src='".$url."' border='0' height='".$mh."px' class='attach' /></a>";
            }            
        } 
        else 
        {
            return "<img src='".$url."' border='0' />";
        }


Something along those lines I presume should help remove the lagging, but of course the entire image still loads up but in a smaller space.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...