How to Adjust Thumbnail Content Size in MacOS Quick Look Plugin Using JavaScript?

I’m trying to fix an issue with a Quick Look plugin where thumbnails are generated using JavaScript in the thumbnail.html file. The problem is that the content doesn’t scale properly to fit the thumbnail size.

How can I access the actual dimensions of the thumbnail within the JavaScript code in thumbnail.html to adjust the content accordingly? Any advice or code examples would be greatly appreciated!