Changing background colour of thumbnails

9 years 1 month ago #2455 by petermac
Hi,

I like the plugin very much and I have managed to use caption.txt files to provide translations of the image data; very cool plug in.

One thing I would like to do is change the colour of the background in the thumbnails - this is because the pictures are different sizes but I don't really want to crop them and it will look better.

As I understand it, the code that creates the background in showthumb.php is (for a jpg image):

$dst_img = imagecreatetruecolor($new_w, $new_h);

I have changed this so that it now reads:

$dst_img = imagecreatetruecolor($new_w, $new_h);
$red = imagecolorallocate($dst_img, 255, 0, 0);
imagefill($dst_img, 0, 0, $red);

As far as I can see, this should create a red background, rather than a black one. Unfortunately this doesn't work. Can anyone point me in the right direction?

Many thanks,

Pete

Please Log in to join the conversation.

9 years 1 month ago #2461 by Vitja
Please login to view the response. Attention: You need a valid subscription to activate an account.

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997

Please Log in to join the conversation.

9 years 1 month ago #2716 by petermac
Replied by petermac on topic Aw: Changing background colour of thumbnails
Please login to view the response. Attention: You need a valid subscription to activate an account.

Please Log in to join the conversation.

9 years 1 month ago #2717 by Vitja
Please login to view the response. Attention: You need a valid subscription to activate an account.

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997

Please Log in to join the conversation.

9 years 3 weeks ago #2940 by andykoa
Replied by andykoa on topic Aw: Changing background colour of thumbnails
Please login to view the response. Attention: You need a valid subscription to activate an account.

Please Log in to join the conversation.

9 years 2 weeks ago - 9 years 2 weeks ago #2941 by Vitja
Please login to view the response. Attention: You need a valid subscription to activate an account.

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997

This message has an attachment file.
Please log in or register to see it.

Please Log in to join the conversation.

Time to create page: 0.166 seconds