Automatic image resizing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • medved
    Senior Member
    • Apr 2008
    • 168

    Automatic image resizing

    Just would like to ask. Is there a software in vB 5 for automatic resizing/down scaling, reducing the size of images people are posting? There are people who use smartphones now. They just take a photo with their smartphone and then they want to upload that photo in full size to the post. But that kind of image is extremely big and they are lazy, or don't have the software needed to resize the image to the maximum size accepted by the forum.

    It looks like there isn't:

    Click image for larger version

Name:	datauploaalimit.JPG
Views:	208
Size:	12.0 KB
ID:	4406429

    So my question is if any software is planed for vB5 that could handle the automatic image resizing?

    Please let me know.
    thanks.
  • In Omnibus
    Senior Member
    • Apr 2010
    • 2310

    #2
    You can increase your PHP limits if you have access to your php.ini file. I've increased mine to 1.0GB. It really depends on your server and your site traffic. 4.0MB is a fairly small limit for images.

    Comment

    • medved
      Senior Member
      • Apr 2008
      • 168

      #3
      I only want images no larger than 1.5 MB. I need to save space on the server. But the forum should have some kind of software to automatically reduce the size of the image so that the user doesn't have to do it.

      Comment

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

        #4
        Originally posted by medved
        I only want images no larger than 1.5 MB. I need to save space on the server. But the forum should have some kind of software to automatically reduce the size of the image so that the user doesn't have to do it.
        Before we can resize it down to the limit, the entire image has to be uploaded to the server. At least temporarily. The image triggering the error is over the limit allowed by PHP so will fail before vBulletin can try to resize it. There is no way around this. We cannot manipulate files until the entire file is on the server to begin with.

        The way around this is to increase the file upload limit within PHP. If you want people to be able to upload images directly from their phones, you need to allow 12-16 megapixel images to be uploaded. This means you need to set the PHP variables of upload_max_filesize and post_max_size to at least 16 MB. 20 MB would be better. These are set in your php.ini file. Once the file is uploaded, then vBulletin will attempt to resize it down the limits set in the AdminCP.
        Last edited by Wayne Luke; Wed 16 Jan '19, 8:25am.
        Translations provided by Google.

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

        Comment

        • medved
          Senior Member
          • Apr 2008
          • 168

          #5
          So does that mean that vB 5 actually has an image resize function?

          I cant find any php.ini file in the root directory. Can you please tell me how I can find that file?

          Thanks

          Comment

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

            #6
            Yes. vBulletin has supported the resizing of images since the 2.X series. vBulletin 5 continues this feature.

            You need to discuss modifications to the php.ini file with your hosting provider. It is not a file that we provide.
            Translations provided by Google.

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

            Comment


            • medved
              medved commented
              Editing a comment
              Thanks, will contact the hosting provider.
          • medved
            Senior Member
            • Apr 2008
            • 168

            #7
            Originally posted by Wayne Luke
            ......The way around this is to increase the file upload limit within PHP. If you want people to be able to upload images directly from their phones, you need to allow 12-16 megapixel images to be uploaded. This means you need to set the PHP variables of upload_max_filesize and post_max_size to at least 16 MB. 20 MB would be better. These are set in your php.ini file. Once the file is uploaded, then vBulletin will attempt to resize it down the limits set in the AdminCP.
            So if I understand it correctly, this website vbulletin.com, actually is not using the image resize function? Because if it did, I could upload even larger image than 4.0MB, and the image resize function would reduce the size to 4.0MB.

            Why this website is not using the image resize function?

            Comment

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

              #8
              We do. It is a native function of vBulletin and enabled by default on all installations.

              Our Datacenter team has decided to limit the PHP Upload limit to 4 MB. Don't know why they made that decision. So any file over that limit cannot be uploaded and therefore cannot be resized. It can't be resized because the image would never be uploaded in the first place. This should be fine since users shouldn't be uploading large images taken with smart phone cameras to this site.

              The image below was stored on my machine as a 3000 X 2000 pixel image. Our system would have stored it at a max size of 2000 X 2000. It is stored as 2000 X 1333. I have resized it down further with the functionality of the editor so it fits the browser window. The original 3000 X 2000 image is attached as a ZIP file.
              Click image for larger version

Name:	pexels-photo-87584.jpeg
Views:	247
Size:	137.2 KB
ID:	4406462

              Attached Files
              Last edited by Wayne Luke; Wed 16 Jan '19, 11:53am.
              Translations provided by Google.

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

              Comment

              • medved
                Senior Member
                • Apr 2008
                • 168

                #9
                Sorry, I meant to lower the number of MB. I need a software to reduce the MB, like for example from image with 20 MB i want the software to reduce it to 1 MB or 600 KB. Because for me is important to save space on the server.

                Why users shouldn't be uploading large images taken with smart phone cameras to this site, when you have a software that can reduce the size and MB? Any other technical reasons for that?

                Thanks

                Comment

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

                  #10
                  Originally posted by medved
                  Sorry, I meant to lower the number of MB. I need a software to reduce the MB, like for example from image with 20 MB i want the software to reduce it to 1 MB or 600 KB. Because for me is important to save space on the server.
                  If you want to upload 20 MB images, then PHP needs to be allowed to accept 20 MB images. If PHP can only accept 4 MB images, the upload will FAIL before it even gets to vBulletin. vBulletin cannot resize a FAILED upgrade. The file won't exist on the server.


                  Why users shouldn't be uploading large images taken with smart phone cameras to this site, when you have a software that can reduce the size and MB? Any other technical reasons for that?
                  This is a technical support site. It isn't an image sharing site. There is no reason for anyone to upload high resolution photographs to receive support. Screenshots don't have the same resolution as photographs taken with a camera.

                  Translations provided by Google.

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

                  Comment

                  • medved
                    Senior Member
                    • Apr 2008
                    • 168

                    #11
                    Originally posted by Wayne Luke

                    Before we can resize it down to the limit, the entire image has to be uploaded to the server. At least temporarily. The image triggering the error is over the limit allowed by PHP so will fail before vBulletin can try to resize it. There is no way around this. We cannot manipulate files until the entire file is on the server to begin with.

                    The way around this is to increase the file upload limit within PHP. If you want people to be able to upload images directly from their phones, you need to allow 12-16 megapixel images to be uploaded. This means you need to set the PHP variables of upload_max_filesize and post_max_size to at least 16 MB. 20 MB would be better. These are set in your php.ini file. Once the file is uploaded, then vBulletin will attempt to resize it down the limits set in the AdminCP.
                    OK, so i was able to o increase the file upload limit within PHP to 20MB. I uploaded the image of 3MB. The forum is set to 1.5MB max. And it worked. The forum did reduce the MB to 937 kB. That is good. But then I wanted to make the image also smaller, to change the dimensions. But this the forum software was not able to do:
                    Click image for larger version

Name:	resize.JPG
Views:	257
Size:	26.6 KB
ID:	4406557

                    So am I right, the forum is not able to edit also the dimensions?

                    Comment


                    • In Omnibus
                      In Omnibus commented
                      Editing a comment
                      You can edit the dimensions as Wayne Luke shows in the post below but the dimensions and the image size in MB are two different things. You can have huge images that take up less physical memory than small images, depending on things like image file type and DPI resolution.
                  • Wayne Luke
                    vBulletin Technical Support Lead
                    • Aug 2000
                    • 74123

                    #12
                    You can adjust the maximum upload dimensions in the /core/includes/config.php. Current versions of vBulletin 5 allow larger values by default but if you're using an older config.php file, then the changes wouldn't be applied since we don't overwrite that file.
                    Code:
                    // ******** 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;
                    That said, resizing isn't miracle work. vBulletin has limitations that a graphic editor does not. The primary one is that we do not know what resources are available on your server. Your limits are from the vBulletin 4.X days. That is a decade ago.
                    Translations provided by Google.

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

                    Comment

                    • medved
                      Senior Member
                      • Apr 2008
                      • 168

                      #13
                      OK, it works, thanks for info. But it looks like the old images on the forum stopped working. They are not loading. Is it possible to fix that somehow?

                      Comment

                      • medved
                        Senior Member
                        • Apr 2008
                        • 168

                        #14
                        Originally posted by medved
                        OK, it works, thanks for info. But it looks like the old images on the forum stopped working. They are not loading. Is it possible to fix that somehow?
                        I was adding also SSL certificate. Could it have something to do with that?

                        Comment

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

                          #15
                          Yes... Your browser will block HTTP requests if you turn on HTTPS. This isn't something we can control. You need to add a server level redirect so that all HTTP requests get turned into HTTPS requests or use a browser extension like HTTPS Everywhere.
                          Translations provided by Google.

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

                          Comment

                          Related Topics

                          Collapse

                          Working...