Rebuilding attachments gives an error for psd files


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

Server Error Log
Error Info
XenForo_Exception: Thumbnail rebuild error /srv/www/ 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/ XenForo_Image_ImageMagick_Pecl::createFromFileDirect('/srv/www/example...', 5)
#1 /srv/www/ XenForo_Image_Abstract::createFromFile('/srv/www/exampl...', 5)
#2 /srv/www/ XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.9999990463257, '')
#3 /srv/www/ XenForo_Model_Deferred->runDeferred(Array, 7.9999990463257, '', false)
#4 /srv/www/ XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
#5 /srv/www/ XenForo_Model_Deferred->run(true, NULL, '', false)
#6 /srv/www/ XenForo_ControllerAdmin_Tools->actionRunDeferred()
#7 /srv/www/ XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /srv/www/ XenForo_FrontController->run()
#9 {main}
Request State
array(3) {
  ["url"] => string(60) ""
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  ["_POST"] => array(3) {
    ["redirect"] => string(65) ""
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"


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


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

Chris D

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

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.