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

Automatically adjust image file size in combination with width/height

Discussion in 'Media Gallery Suggestions' started by Gladius, Jun 29, 2016.

  1. Gladius

    Gladius Well-Known Member

    Right now, the only option to make image uploads as user-friendly as possible is to set high image width/height dimensions and unlimited file size (MB). However, this does not allow us to control the image size in any way.

    Doing it the other way around, setting a fixed file size (MB) and unlimited image dimensions, will reject all attempts at uploading images larger than what's set as the max file size (MB) instead of allowing the larger uploads but resizing the images to whatever is set as the max file size (MB) and leaving the original image dimensions intact.

    So what I'd like to see is the option for all the possible image permissions to be respected by the gallery itself automatically and not requiring the users to figure out how to work with the gallery's permissions because that's a) user-unfriendly and b) completely unnecessary.

    I somehow managed to not notice this before: "Provide the maximum media file size in megabytes (MB). Media over this size will be rejected." but the bolded bit is really horrible from a usability POV. Rejecting uploads over something that can easily be automated is something that should never happen. When faced with upload fail due to that, how many people will just not bother with resizing their images and skip the upload altogether and/or not even know how to resize their images? Whatever the % is, we could easily avoid it.
     
    Mijo and rickhz like this.
  2. rickhz

    rickhz Member

    Having to resize images is a very long standing complaint of forum users. It's definitely something that frustrates the newbies, and those who want to post directly from their megapixel cell phones... which is practically everyone these days.
     
    TS20 and Gladius like this.
  3. Ernest L. Defoe

    Ernest L. Defoe Well-Known Member

    I can understand people's frustrations but it's not only forums that resize. Facebook, Twitter and Instagram all do it. Yeah it might not be as noticeable as far as the time it takes on those services but all photos uploaded to them get resized.
     
  4. Gladius

    Gladius Well-Known Member

    I think that you're missing the point... we're saying XFMG should resize images automatically like Facebook etc., but it doesn't... it REJECTS large images instead of automatically resizing them to the MB size specified by the admin.
     
    TS20 and rickhz like this.
  5. Ernest L. Defoe

    Ernest L. Defoe Well-Known Member

    Oh ok. Sorry misunderstood.
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    I just want to make something clear, as it isn't clear from @Gladius's posts.

    XF will reject images that exceed the max file size, but it will not reject an image that exceeds the maximum width and height. If a maximum width and height is set, the image will be automatically resized. Of course resizing images will reduce the file size too.

    The only way to not reject an image which exceeds the maximum file size is for us to guess (or crudely calculate) what to resize the image to. This seems far from ideal, therefore the optimum way of ensuring files do not take up much space.

    In the example I just uploaded to this album, the original image (not resized) is over 4MB. The resized image is 261KB.

    https://xenforo.com/community/media/albums/test-album.241/

    Put simply, if you set a max width and height, you're always going to get a considerably smaller file size images and therefore it is the perfect way of controlling disk space usage.

    I'm not sure what you feel is wrong with that concept, but it's a tried and tested approach since XF 1.0 (it works the same for XF attachments).
     
  7. Gladius

    Gladius Well-Known Member

    Personally, I'm fine with setting a max width and height, but others might not be, depending on their gallery usage. I know now what I can expect MB size-wise after setting a certain max width and height in XFMG, but there's no way for anyone to know that in advance short of trial and error, is there? I haven't seen it specified/adjustable anywhere what settings XFMG uses to resize images over the set dimensions, so I assumed that a very large MP image even when resized could still easily be over 1MB in size. Now if the resizing settings were easily visible, adjustable and explained, this would be a completely different story.
     
  8. Gladius

    Gladius Well-Known Member

    A simple illustration of the problem further... one of our users uploaded a few dozen game screenshots. No biggie, right? Standard 1920x1200 res, under the 2000x2000 dimensions I set so they all uploaded fine. Only I checked one today and noticed that they're 4,9MB PNGs each. 20 screenshots amount to 100MB...
     

Share This Page