Fixed Error: Call to a member function getWidth() on null src/addons/XFMG/Service/Media/Watermarker.php:53

AndyB

Well-known member
Affected version
2.2.2
The following error will occur:

Error: Call to a member function getWidth() on null src/addons/XFMG/Service/Media/Watermarker.php:53

Under the following conditions:

SELECT * FROM xf_attachment
INNER JOIN xf_attachment_data ON xf_attachment.data_id = xf_attachment_data.data_id
INNER JOIN xf_mg_media_item ON xf_attachment.content_id = xf_mg_media_item.media_id
WHERE xf_attachment.content_type = 'xfmg_media'
AND xf_attachment_data.width = 0
AND xf_mg_media_item.media_type = 'image'

Under normal circumstances this condition should never occur, but on a forum I help on this happened. The file system had the correct PDF file, but somehow the database table had it as an image with 0 width. This caused the server error which running the watermark rebuild process.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFMG release (2.2.4).

Change log:
Do not attempt watermarking if a valid source image can not be created
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom