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

Fixed Thumbnail with width/height < 1 pixel

Discussion in 'Resolved Bug Reports' started by Logician, Oct 8, 2010.

  1. Logician

    Logician New Member

    Hey there,

    While trying to import vb attachments, I got a "server error" and it halted. In debug mode, I got more info about the error:
    After some debugging, I noticed, the problem is library/xenforo/image/gd.php in line
    $newImage = imagecreatetruecolor($width, $height);

    Apparently if image is very tiny and has a 0.x width or height, imagecreatetruecolor is rounding it to 0 and dieing with error.

    So adding this line right above it fix the problem:
            // Logician Fix : Import Bug for pictures that have 0.xx dimensions
            if ($width < 1)
                $width = 1;
            if ($height < 1)
                $height = 1;
            // Logician Fix : Import Bug for pictures that have 0.xx dimensions

    BTW. IMO you should consider giving write access to coders in community support forums. I don't have xenforo myself so I can't get my account associated with a license to get posting permissions but I'm doing work for one of my clients so have still things to report there. If you can implement a vb member area like feature where a license owner can associate multiple forum user accounts with his license, it will be helpful.
  2. Peggy

    Peggy Well-Known Member

    Hi Logician, good to see you here.
  3. Logician

    Logician New Member

    Thanks Peggy! :)
  4. Mike

    Mike XenForo Developer Staff Member

    BTW, there is a "forum users" part of the customer area. Your client can add your user name there.
  5. Mike

    Mike XenForo Developer Staff Member

    Fixed, thanks :)

Share This Page