1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Limit 'link' image sizes

Discussion in 'XenForo Questions and Support' started by billybatz9, Aug 17, 2013.

  1. billybatz9

    billybatz9 Active Member

    Right now, there is an option to resize images when they are 'uploaded'. But I guess it doesn't apply to those images they are being submitted through a link like photobucket. Is there a way I can implement the image resizing for both? If not, this should be added.

    Thanks
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Linked images if they are too large are resized and can be viewed in a full size by clicking on it.

    Technically, the only way to 'resize' these images the same way XenForo resizes attachments is to download them from the remote host and store them on your local server.
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Limit which size?

    Resize in what way?

    Hotlinked images don't exist on the server.
     
  4. billybatz9

    billybatz9 Active Member

    So what you guys are saying is that when a person adds a photo using the image button and having to insert a website url like photobucket or flickr or anything, it doesnt get hosted on my server? Therefore my memory wont increase?
     
  5. billybatz9

    billybatz9 Active Member

    and for example....
    any images being "uploaded from their computer" turns out to be within the dimensions 400x400 because that's what I have it set to.
    However, if a person clicks on the image button to post an image using a photobucket link or something, the image(s) take up the whole screen. They do not stay within the 400x400 dimensions.
    I was just wondering if there was a way to re-size THOSE photos. The ones that people upload using a "link"

    Thanks guys
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Correct.
    The images are hosted elsewhere so don't use any disk space on your server.

    If you want to limit the size of embedded images, add this to EXTRA.css:
    Code:
    .message .messageContent .messageText img {
    max-width: 400px;
    }
    If you don't want images to click zoom, add this instead:
    Code:
    .message .messageContent .messageText img {
    max-width: 400px !important;
    }
    I shall move this thread from suggestions as it's not a valid suggestion.
     
    Samet Chan, Phil, Madhuse and 2 others like this.
  7. billybatz9

    billybatz9 Active Member

    Thank you
     
  8. digitalrage

    digitalrage New Member

    Hello,

    i've tryed to edit the extra.css with the code posted above but it doesn't work as a responsive, i.e. on my mac retina it's ok, on my desktop pc it's ok but when i switch to a Galaxy S5 smartphone or a standard resolution tablet the image is cropped. There is a way to get a workaround about this issue?
    Thanks in advance.
     
  9. Sunka

    Sunka Well-Known Member

    @Brogan, is it possible to add to this code also variable max-height: 400px?
    So if picture is 800px widht and 1600 hight, it will be in post 200px widht and 400px height?
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Add max-height: 400px.
     
    Samet Chan and Sunka like this.
  11. Sunka

    Sunka Well-Known Member

    So I could use both?

    Code:
    .message .messageContent .messageText img {
    max-width: 400px;
    max-height: 400px;
    }
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Yes.
     
    Sunka likes this.
  13. EDCP

    EDCP Member

    Is this still a viable solution to limiting the size of linked image URL's?
     
  14. picom

    picom New Member

    Hi all, sorry for digging up an old thread but I was following the guide above and it worked perfectly for me when shinking the size of images posted onto my site from elsewhere.

    However when someone tried to make a poster they got a server error message, so I had to delete the code again to fix the problem.

    Im using 1.56, is there any option to fix this or something else I need to do?

    Thanks
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

    I would be surprised if that CSS triggered a server error.
     

Share This Page