Setting Image File Size for uploading.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CorbinH
    Senior Member
    • May 2009
    • 232
    • 4.0.0

    Setting Image File Size for uploading.

    Hi Friends,
    In my CP Admin "Attachment Type Manager" the sizes set for the JPEG and JPG are:
    Maximum File-size: 400,000 / Max Width: 1030 / Max Height: 1030
    We have a post with an image uploaded which is 1600px X 1066px and 567kb. Why is this allowed?
    Is there another setting that will disallow image uploads that exceed the settings in "Attachment Type Manager"?
    Also, where do I set Maximum file weight to 250kb?
    Being a novice Admin, detailed instructions would be a great help
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73981

    #2
    The image you say was uploaded would still be allowed. vBulletin can't actually determine the file size or dimensions of an image before it is uploaded to the server. However, vBulletin would attempt to resize the image down to the maximum allowed size even if the user uploads something larger. If it can't resize the image, then it will present the user with an error. We would need access to the database and your server's file system to see if this was not the case.

    In order to allow more seamless uploads from cameras and smart phones, vBulletin actually will try to process any image uploaded that is 4608 X 4608 pixels or smaller.

    I don't know what you mean by maximum file weight. File sizes are set in the AdminCP under Attachments -> Attachment Storage Type.
    Last edited by Wayne Luke; Fri 22 Feb '19, 8:28am.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • CorbinH
      CorbinH commented
      Editing a comment
      Thanks Wayne.
  • In Omnibus
    Senior Member
    • Apr 2010
    • 2310

    #3
    You can control the maximum dimensions using the config.php file:

    // ******** IMAGE PROCESSING OPTIONS ********
    // Images that exceed either dimension below will not be resized by vBulletin.
    // If you need to resize larger images, alter these settings.
    $config['Misc']['maxwidth'] = 4608;
    $config['Misc']['maxheight'] = 4608;

    Unfortunately, images of the same dimensions can be vastly different in the amount of physical space they take up.

    Comment


    • CorbinH
      CorbinH commented
      Editing a comment
      Thanks Omnibus.

    • Wayne Luke
      Wayne Luke commented
      Editing a comment
      Changing these settings can prevent users from uploading images from their phones and other devices. Just to forewarn you.
  • CorbinH
    Senior Member
    • May 2009
    • 232
    • 4.0.0

    #4
    I'm just revisiting this thread in the hope to get an answer for the following. When a user inserts a link to an image on a hosting site, the images are sometimes displayed as being much larger than the settings in "Attachment Type Manager". We have JPG files set to max 1200px wide, 1200px and 350,000 bytes (350kb). The images inserted in the links (eg: from Flickr) are much larger, ie: 1600px X 1200px and 540kb. Is there a setting where I can have the linked images resized to our max settings?

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 73981

      #5
      When vBulletin resizes an image it modifies the actual file and stores it at that size on your server. Images hosted on third-party sites are not resized by the software and are shown at full size. vBulletin doesn't even know what size the third-party image is. Embedding is handled by the browser. This has always been the case. The only way around this completely would be to disallow linking to third-party images under all circumstances and that is going to be difficult as well.

      You can probably work around this by adding the following to your css_additional.css:
      Code:
      img {max-height:1200px !important; max-width:1200px !important;}
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment


      • CorbinH
        CorbinH commented
        Editing a comment
        Thanks for that Wayne - very much appreciated.
    • CorbinH
      Senior Member
      • May 2009
      • 232
      • 4.0.0

      #6
      Hi Wayne, is this what you mean? do I need the "Text Only" box checked?
      Click image for larger version

Name:	SH_511_(001).jpg
Views:	291
Size:	100.8 KB
ID:	4474401

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 73981

        #7
        As a download customer, you don't need to worry about the "Text Only" box.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • CorbinH
          CorbinH commented
          Editing a comment
          Also with the above "css_additional.css entry "img {max-height:1200px !important; max-width:1200px !important;}" does that resize larger images to the 1200px and display it in the post, or does it reject the image link entirely with an error message. I haven't tried this as yet because I wasn't sure on what would happen if the images on the hosting sites were larger than 1200px.

        • Wayne Luke
          Wayne Luke commented
          Editing a comment
          Also with the above "css_additional.css entry "img {max-height:1200px !important; max-width:1200px !important;}" does that resize larger images to the 1200px and display it in the post, or does it reject the image link entirely with an error message. I haven't tried this as yet because I wasn't sure on what would happen if the images on the hosting sites were larger than 1200px.
          It will resize images larger than the max-height and max-width to that size. Images smaller then that sized will not be resized. This resizing is done by the browser and is a display change only.

        • CorbinH
          CorbinH commented
          Editing a comment
          Many thanks - appreciated.

      Related Topics

      Collapse

      Working...