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

Not a bug Server Error on rotating an image

Affected version
1.1.13

Freelancer

Well-known member
#1
I (successfully) rotated an image of one of my users but got this Server Error

XF 1.5.14
XFMG 1.1.13
PHP 7.0.18

Code:
Error Info
imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG
 - library/XenGallery/Helper/Image.php:809

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'imagecreatefrom...', '/var/www/client...', 809, Array)
#1 /var/www/clients/client180/web812/web/library/XenGallery/Helper/Image.php(809): imagecreatefromjpeg('/var/www/client...')
#2 /var/www/clients/client180/web812/web/library/XenGallery/Model/Media.php(811): XenGallery_Helper_Image->rotate(90)
#3 /var/www/clients/client180/web812/web/library/XenGallery/ControllerPublic/Media.php(1354): XenGallery_Model_Media->rotateMedia(Array, 90)
#4 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(351): XenGallery_ControllerPublic_Media->actionRotate()
#5 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /var/www/clients/client180/web812/web/index.php(13): XenForo_FrontController->run()
#7 {main}

Request State
Array
(
    [url] => https://www.mywebsite.com/media/user-album-name.1820/rotate
    [_GET] => Array
        (
            [/media/user-album-name_1820/rotate] => 
        )

    [_POST] => Array
        (
        )

)
 

Chris D

XenForo developer
Staff member
#2
Unfortunately this is just generally a warning that there's some form of corruption within the image. Warnings are safe to ignore and the operation most likely completed successfully.

Note that interestingly this error was logged despite us setting gd.jpeg_ignore_warning to 1 at run time in the XFMG image handler.

We actually don't do anything in XF (1.x or 2.x) or XFMG (2.x) to attempt to suppress such warnings though you can set gd.jpeg_ignore_warning to 1 inside php.ini manually, or upgrade to PHP 7.1 where it is set by default.