Rebuilding attachments gives an error for psd files

Nuno

Well-known member
When trying to rebuild attachments I get this error.
The attachment is a psd file and I'm using ImageMagick

Code:
Server Error Log
Error Info
XenForo_Exception: Thumbnail rebuild error /srv/www/example.com/public/internal_data/attachments/0/246-a93f34dc503539de0349dd9148445767.data: Invalid image type given. Expects IMAGETYPE_XXX constant. - library/XenForo/Image/ImageMagick/Pecl.php:85
Generated By: Nuno, Yesterday at 10:33 PM
Stack Trace
#0 /srv/www/example.com/public/library/XenForo/Image/Abstract.php(254): XenForo_Image_ImageMagick_Pecl::createFromFileDirect('/srv/www/example...', 5)
#1 /srv/www/example.com/public/library/XenForo/Deferred/AttachmentThumb.php(40): XenForo_Image_Abstract::createFromFile('/srv/www/exampl...', 5)
#2 /srv/www/example.com/public/library/XenForo/Model/Deferred.php(295): XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.9999990463257, '')
#3 /srv/www/example.com/public/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999990463257, '', false)
#4 /srv/www/example.com/public/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
#5 /srv/www/example.com/public/library/XenForo/ControllerAdmin/Tools.php(159): XenForo_Model_Deferred->run(true, NULL, '', false)
#6 /srv/www/example.com/public/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Tools->actionRunDeferred()
#7 /srv/www/example.com/public/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /srv/www/example.com/public/admin.php(13): XenForo_FrontController->run()
#9 {main}
Request State
array(3) {
  ["url"] => string(60) "http://www.example.com/admin.php?tools/run-deferred"
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["redirect"] => string(65) "http://www.example.com/admin.php?tools/rebuild&success=1"
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
 
Note that the rebuild process should continue.

The problem is generally that we would never build a thumbnail for that file. This presumably means that a thumbnail was built from a non-standard set of code. This would really mean that the thumbnail should be removed for that (which would require removing the thumbnail dimensions from the record in the database).
 
Chris, It's an attachment only.

If you remember, I got that bug in xfmg that didn't update the W x H in attachment_data and I updated by hand all fields, this one should not be updated.

Thanks for you help.
 
I recall something about an add-on you've used to resize the images, too, I'm not sure if that is related.

Either way, to prevent this error from being logged in the future, it's likely just a case of running this query:

Code:
UPDATE xf_attachment_data
SET thumbnail_width = 0, thumbnail_height = 0
WHERE data_id = 246

That should ensure that file is skipped when the thumbnails are rebuilt in the future. Unless you got any other errors, everything else should have completed as expected.
 
Top Bottom