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

XF 1.3 Automatic image/ attachment resizing

Discussion in 'XenForo Questions and Support' started by airbrushtutor, Jun 27, 2014.

  1. airbrushtutor

    airbrushtutor Member

    Hi everyone,

    I want to ask if there is an addon available that doesn't reject the attachment that is too large, but instead resizes it to either of the max pixel or max filesize settings in the control panel?
    For example, tapatalk gives the option to provide different image sizes..
    Is this something that i'm overlooking or something that doesn't yet exist?

    I've done a search on google and this forum for the answer but i've only found plug-ins that will work after the fact.

    Just a bit antiquitated when it rejects an image for size, when GD functions can resize easily..
    Any advice, help would be appreciated :)
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The FAQ explains how attachments are handled.

    Why can't I upload an image, even though it is smaller than the maximum dimensions (pixels) permitted?
    Server-side file size (KB) resizing is not supported. Any files which are larger than the maximum size specified in theACP -> Options -> Attachments: Maximum Attachment File Size (KB) will be rejected.


    Why can I upload an image, even though it is larger than the maximum file size (KB) permitted?
    Uploaded files are first resized based on the maximum physical dimensions (pixels) set in the ACP -> Options -> Attachments: Maximum Attachment Image Dimensions. If the resized image is below the maximum file size (KB) limit, then it will be allowed.
    Note that with XenForo 1.2 and above, by default, images of 20 megapixels and over will not be resized; this is to prevent fatal errors due to running out of memory. If the Maximum Attachment Image Dimensions combined total (width x height) is set lower than this limit, images greater than 20 megapixels, or with a dimension larger than that permitted, will be rejected with an error stating The uploaded image is too big. If the Maximum Attachment Image Dimensions combined total (width x height) is set to 0 or greater than 20 megapixels, the image will appear as an attachment without a thumbnail. The 20 megapixels limit can be changed using a config.php switch; refer to this section of the XenForo Manual.

    http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-180445

    You should be able to achieve what you want by changing the various settings.
     
  3. AndyB

    AndyB Well-Known Member

    Hi airbrushtutor,

    What are your current setting for the following:

    Admin CP -> Options -> Attachments -> Maximum Attachment File Size (KB)

    and

    Admin CP -> Options -> Attachments -> Maximum Attachment Image Dimensions
     
  4. airbrushtutor

    airbrushtutor Member

    okay perfect, so instead of setting my max pixel width to 2500 px - if i set it to 1250px, then more images should be successfully uploaded?
    The reason i ask is to future proof for retina displays.. as i've heard they require double the pixels of a regular image to display correctly..
    thanks :)

    @AndyB - 2500px width, 0 height and 1024kb
     
  5. AndyB

    AndyB Well-Known Member

    My settings are:

    Maximum Attachment File Size (KB) = 3000

    Maximum Attachment Image Dimensions = 1600 x 1600
     
    Dryline likes this.
  6. AndyB

    AndyB Well-Known Member

    Seams like you shouldn't have an issue with these settings. Do you have the dimensions of the attachment you were trying to upload? There are other limits.
     
  7. airbrushtutor

    airbrushtutor Member

    1600 x 1600 - i've seen that in a few places - might go for that :) thanks for the quick advice @AndyB and @Brogan :)
     
  8. AndyB I want thank you. Because of this thread and another you participated in, I was able to solve my problem. My settings are now the same as yours. This was a big problem on my forum. You solved it for me.
     

Share This Page