Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Suggestion Ban embedded images wider than my monitor

  1. Sep 25, 2010 #1
    Or at least make it so they only stretch the post they are in, rather than the entire thread. It becomes a nuisance to read threads with large images in them when I have to scroll over to read the text on every single post. There must be a way to force all the text in the thread to wrap normally, even when there's a large image present.
     
  2. jcsd
  3. Sep 25, 2010 #2
    Re: Ban imbedded images wider than my monitor

    Yes, we should ban everyone from doing something so you don't have to find a solution. o_O
     
  4. Sep 25, 2010 #3

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Re: Ban imbedded images wider than my monitor

    Wide images break the forum. Yes, one can work around the break, but it's still broken nonetheless. It (along with 1000 character "words") deserves at least a warning for obnoxious behavior.
     
  5. Sep 25, 2010 #4

    mheslep

    User Avatar
    Gold Member

    Re: Ban imbedded images wider than my monitor

    Maybe the server could autoresize the images when above some limit?
     
  6. Sep 25, 2010 #5
    Re: Ban imbedded images wider than my monitor

    How hard would it be to make the rest of the posts in the thread behave normally, and have only the posts with larger images/longer words extended?
     
  7. Sep 25, 2010 #6
    Re: Ban imbedded images wider than my monitor

    I'm thinking it may well be difficult, because I've not yet been a participant on a message board that didn't get all screwed up, width-wise, as a result of really large images.

    I'm onside with the OP's annoyance. When someone posts a picture that stretches thread-width so I have to scroll side-to-side to read, then I either just advance to the next page or give up on the thread entirely. It's too much of a pain in the butt to try and continue.

    Maybe just a restriction on the size of photos that can be posted could be the easiest way to go? I know I'd love to do that with my board and have no clue how.
     
  8. Sep 25, 2010 #7

    DaveC426913

    User Avatar
    Gold Member

    Re: Ban imbedded images wider than my monitor

    It's a lot of work. And no one qualified (or at least, inclined) to do it.

    Autoresizing all images to have a max width is the better solution.
     
  9. Sep 25, 2010 #8

    diazona

    User Avatar
    Homework Helper

    Re: Ban imbedded images wider than my monitor

    That would actually be difficult, since the threads are laid out using HTML tables and browsers don't support making one row of a table wider than the others. But I think the problem could be solved with the CSS overflow property.
    Code (Text):
    td.alt1 {max-width: 700px}
    td.alt1 > div {overflow: auto}
    fixes it for me on FF 3.6. It puts a scrollbar on the post whenever the content is wider than the screen.

    Or if you didn't want to rely on what appears to be a strange quirk in Firefox, the max-width could be set by a bit of Javascript.
     
  10. Sep 25, 2010 #9

    Pengwuino

    User Avatar
    Gold Member

    Re: Ban imbedded images wider than my monitor

    Get wider eyes.
     
  11. Sep 25, 2010 #10

    Evo

    User Avatar

    Staff: Mentor

    Re: Ban imbedded images wider than my monitor

    Unless Greg can find a way, resizing means that I have to copy the picture to my hard drive, then upload it to my personal image account and resize it, then replace the oversized image. Keeping the link to my personal account.

    No.

    If you guys would like me to delete all oversized photos, say so here and I will delete them.
     
  12. Sep 25, 2010 #11
    Oversized photos could be linked to instead of embedded. Could greg make a button for mentors to automatically replace them with links?
     
  13. Sep 26, 2010 #12
    Re: Ban imbedded images wider than my monitor

    Two more comments:

    1) In PF Mobile, images are automagically resized to fit.

    2) Could a mentor please fix the spelling of 'embedded' in the thread title, it's driving me nuts.
     
  14. Sep 26, 2010 #13
    Re: Ban imbedded images wider than my monitor

    That is likely a feature of whatever mobile browser you are using.
     
  15. Sep 26, 2010 #14

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Ban imbedded images wider than my monitor

    That's what I do whenever I find an image that is too big for the screen: edit the post to remove the image tags and leave the url. Just report the next wide image you see, and we can do this.
     
  16. Sep 26, 2010 #15
    yeah, right. Personally, I would like to see the software first check the size of it, and if it's too large, then pass the image to some application which cuts it down to a reasonable single-screen image of the picture but yet, still give the user an option to override this feature if they have privs and say so.
     
    Last edited: Sep 26, 2010
  17. Sep 26, 2010 #16

    DaveC426913

    User Avatar
    Gold Member

    Re: Ban imbedded images wider than my monitor

    What? No.

    I don't mean literally resaving the image, I mean simply displying it at a limited size.
    All you need so is set width="x" in the image tag if the image's width is > x.
     
  18. Sep 26, 2010 #17

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    Re: Ban imbedded images wider than my monitor

    I'm pretty sure you can't do that with the forum img tags.
     
  19. Sep 26, 2010 #18

    DaveC426913

    User Avatar
    Gold Member

    Re: Ban imbedded images wider than my monitor

    Of course you can.


    It's just a bit of custom code.
    Code (Text):
    <script>
        if (document.thisImage.width > maxWidth){
            document.write("<img width='" + maxWidth + "'/>")
        }
        else{
            document.write("<img/>")
        }
    </script>
    Or the PHP equivalent.
     
  20. Sep 26, 2010 #19

    cristo

    User Avatar
    Staff Emeritus
    Science Advisor

    Last edited by a moderator: Apr 25, 2017
  21. Sep 26, 2010 #20

    DaveC426913

    User Avatar
    Gold Member

     
    Last edited by a moderator: May 4, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook