- 🇨🇦Canada teknocat
The only problem I see with this patch is that it does away with the use of the Spatie PDF to Image library, which accounts for various other things and additional options during the process of generating thumbnails, including an allowance for generating thumbnails for remote images.
It is advantageous to keep using the spatie pdf library, but there isn't an easy way to use that and composite it onto a white background outside of that library (I tried that). However, if it uses the PNG format then transparency is allowed and you don't get a white background. This introduces a different issue, in that the thumbnails might not look good against whatever background colour they are on, but that problem can be easily resolved with CSS.
It's a very simple solution and, if desired, the settings form could be updated to allow the developer to choose the desired format for any given thumbnail format. However, that means you'd then have to make sure you set it consistently in all places.
As such, I suggest simply changing it to use PNG format as a default and I will submit a merge request with that solution for people to try out.
- @teknocat opened merge request.
- 🇨🇦Canada teknocat
While the PNG option worked fine on my local machine on macOS, I found I still got a black background on my web server. This could just be due to the version of ImageMagick, so if that's the case then the first patch on this issue is better and it could be expanded on later if needed.
- Status changed to Needs work
over 1 year ago 2:57pm 12 July 2023 - 🇨🇭Switzerland sraLton
My patch is definitely not the solution, since the transparency shouldn't be white.
Therefore changing the status again. - Status changed to Fixed
about 1 year ago 9:56am 15 August 2023 - 🇫🇷France sgostanyan
Image format selection has been introduced in version 6 Usage in Media view mode →
Thanks for your report
- Status changed to Fixed
about 1 year ago 8:59am 20 August 2023 - 🇨🇦Canada teknocat
Image format selection doesn't solve the problem. I have PDFs that have transparent background, using JPEG format for thumbnails, they still have a black background. Perhaps it would be prudent to add a config option to specify a default background colour to use?
- 🇨🇦Canada teknocat
Oh wait I think that's just me being dumb. Should use PNG rather than JPEG to leave backgrounds transparent.
- 🇮🇹Italy finex
Hi, I confirm that PNG format works fine, it should be added the option to set the background color when using jpg format instead of using the black default color.