Describe the bug
User attempts to use a .bmp image as a cover image for a book. They get an unhelpful "unknown error" page.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
A more useful error message and no crash.
Your Configuration (please complete the following information):
Additional context
[2020-03-31 18:09:56] production.ERROR: BMP format is not supported by Gd Driver. {"userId":6,"exception":"[object]
(Intervention\\Image\\Exception\\NotSupportedException(code: 0): BMP format is not supported by Gd Driver. at /var
/www/BookStack/vendor/intervention/image/src/Intervention/Image/Gd/Encoder.php:96)
[stacktrace]
#0 /var/www/BookStack/vendor/intervention/image/src/Intervention/Image/AbstractEncoder.php(151): Intervention\\Imag
e\\Gd\\Encoder->processBmp()
#1 /var/www/BookStack/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(79): Intervention\\Image\
\AbstractEncoder->process()
#2 /var/www/BookStack/vendor/intervention/image/src/Intervention/Image/Image.php(121): Intervention\\Image\\Abstrac
tDriver->encode()
#3 /var/www/BookStack/app/Uploads/ImageService.php(258): Intervention\\Image\\Image->encode()
#4 /var/www/BookStack/app/Uploads/ImageService.php(82): BookStack\\Uploads\\ImageService->resizeImage()
#5 /var/www/BookStack/app/Uploads/ImageRepo.php(130): BookStack\\Uploads\\ImageService->saveNewFromUpload()
#6 /var/www/BookStack/app/Entities/Repos/BaseRepo.php(83): BookStack\\Uploads\\ImageRepo->saveNew()
Thanks @lpar for reporting. Can confirm this being an issue, The underlying driver does not support the bmp format. Also causes issues for page content.
Since this is the first time this has been raised, I'm tempted just to removed bmp as a supported image upload extension. Same with tiff.
That's what I'd do. No reason people should be using BMP or TIFF files with any web-based application. In fact, BMP files are basically obsolete for all purposes.
Cool, Have assigned to be addressed in the next feature release.
Patch now in master, to be in v0.29.0. Thanks again for reporting.
Most helpful comment
That's what I'd do. No reason people should be using BMP or TIFF files with any web-based application. In fact, BMP files are basically obsolete for all purposes.