Support is part of Event Gallery Extended.

Please get a subscription if you need support. Feel free to use the ticket system or the contact form for reporting defects or pre-sale questions. Make sure you're logged in in order to be able to create a new ticket.

For general information you can also jump to the manual.

Subscribe now!

#2639 Transparent png with black background

Posted in ‘Event Gallery - General’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by sbluege on Thursday, 06 April 2017 12:29 UTC

Genito
Hi Sven

I already made a similar ticket (#2619).
You gave some guidance of what php file to edit and possibly what code.

However it turns out I'm just too foreign with PHP code, and I'm hoping you can help me out once again.

In the previous ticket you mentioned the solution would be to edit in following:
components\com_eventgallery\library\common\imageprocessor.php

It would be more than fine if it could just be a white background (or if possible a transparent background).
As you've mentioned in previous ticket there should be a solution in some comments here stackoverflow.com

Also I bought the Extended Event Gallery which works great thank you!

sbluege
Having transparent images will not work since the thumbnails are always jpeg files. But you can change the background like this.

Add this to the resize function in the file components\com_eventgallery\library\common\imageprocessor.php

// set background to white
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $white);


I attached a screenshot and hope this helps.

sbluege
by the way, you're sending auto reply message containing Christmas greetings. The ticket system does not like this very much ;)

Genito
Thank you for the reply!

First of I'm so sorry about the auto reply. When I bought the extended version I changed the email to my colleague responsible for invoices, who is currently on a business trip, but apparently set a wrong autoreply, which I have now fixed for her... >D

Also I have changed this account back to my email again. I was unaware that it was a change of account mail when I wrote what email to confirm the subscription to, and was actually wondering why I didn't get a mail of your response.
Everything should work out now :)

Second I've tried to add your code, but I'm afraid it didnt do much... Except now the sites got a little problem loading either thumbnails or lightbox versions and I have to refresh page for it to work.

I read in some comments on stackoverflow, that it might be an alpha setting needed?

I doubt the code would work on already uploaded images? The way I tested the new code, is by creating a new Event Album and uploading new images. You can see my site here.

Sorry if I'm confusing!

sbluege
It seems to work... a bit.

Did you add that code in the right place? Does not look like this.

To see changes you need to clear the thumbnail cache on the server. Otherwise you only see the old cached versions.

Example URL:
http://genito.dk/index.php?&mode=nocrop&width=1388&folder=Studio_Ballet325_Small_Lyon&file=Ballet-325-high-small-lyon-black-hjul.png&option=com_eventgallery&view=resizeimage

Genito
Hmm I'm not seeing any examples of it working >.<

Ive added 3 images.
imageprocessor_code.jpg = How it looks in my code now.
onmyscreen.jpg = How it looks after I cleared all cache in joomla.
theimageyoulinked = Your image example got a black background on my screen?

sbluege
Ups... I send you the wrong code snippet :)

// set background to white
        $white = imagecolorallocate($im_output, 255, 255, 255);
        imagefill($im_output, 0, 0, $white);

Genito
THANK GOD!
Seriously tho I thought I was going crazy xD "Am I clearing cache wrong??" Haha

Everything looks great for me now. Thank you very much! I've added an image of how I've changed it to look :)

Have tried 3 different galleries.
This is now the first one for me, which can actually render an acceptable background for my transparent images!

I'll close this ticket :)

sbluege
;-) By the way.. nice usage of the download icon!