Not a bug Server Error on rotating an image

Affected version


Well-known member
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

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
    [url] =>
    [_GET] => Array
            [/media/user-album-name_1820/rotate] => 

    [_POST] => Array


Chris D

XenForo developer
Staff member
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.