HD Quiz

Need to send invoices?
Check out my new WordPress plugin HDInvoice
Limited time launch sale

Hello, I have a problem with the question image. I want …

Published: July 27, 2021
Support status: closed

Hello,

I have a problem with the question image. I want to create some questions related to country flags. However, the question image format is always cropped at a 1:1 ratio (Differences from the original image compared to the library image). So is there any way to fix this situation?

Thank you.

This thread has been imported from harmonicdesign.ca/hd-quiz/

thread author: Huynh Hieu Travel

Hi Huynh,
it is forced to be a 1:1 ratio so that the grid looks and works the best for most users out of the box. Without this, users would upload and use images with different aspect ratios then come to yell at me because their quizzes look ugly and broken haha.

The best solution would be to see if you can either use a different image pack for your flags, or if you could edit the images yourself to make them a better aspect ratio for HD Quiz. If this is not an option for you (maybe you have a lot of flags) then the next best option is to edit HD Quiz directly.

If you edit ./hd-quiz/includes/functions.php and look for the function called hdq_get_answer_image_url. What we need is on line 797.

Edit the line $image_url = wp_get_attachment_image_src($image, "hd_qu_size2", false); and change hd_qu_size2 to full. This will make it so that HD Quiz always uses the original unedited file. No thumbnails, no resizing.

Just note that you would have to make this change each time you update HD Quiz.

28 July 2021 — 15:41 support admin - Dylan

If you are enjoying HD Quiz please leave a review here on the official WordPress.org page. HD Quiz is developed by me, just some dude, and is supported and available for free. It may seem dumb, but truly nothing makes me happier than knowing that people are using and loving HD Quiz and my hard work.

This thread has either been marked as complete or has been automatically closed due to inactivity.