Home Joomla CSS Gallery - FAQ & Troubleshooting
2010-08-01
CSS Gallery Plugin FAQ & Troubleshooting
Written by Andreas Berger   
Tuesday, 24 November 2009 21:04

ERROR: Fatal error: Call to undefined function imagecreatefromjpeg() or imagecreatefromgif() or imagecreatefrompng()

ERROR: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 3264 bytes)

PROBLEM: Only the code {becssg}folder{/becssg*} is shown - usage in module position

 

 

ERROR: Fatal error: Call to undefined function imagecreatefromjpeg() or imagecreatefromgif() or imagecreatefrompng()

If you get this error when trying to open a page that contains a gallery, this means that the GD library, an extension for PHP is not activated at all or does not support the used image file type.
The GD Library, short GD or GDlib, is a program library to dynamically create and manipulate graphics and one of the most widespread extensions of PHP. The CSS Gallery uses this extension to scale the main images and to create the thumbnails.
To check if the GDlib is activated on your server go to the Joomla! administration interface and open Help > System Info >PHP-Information. On this page search for "gd". In the best case you will find a chapter with the following or similar content:

gd

  • GD Support enabled
  • GD Version bundled (2.0.34 compatible)
  • FreeType Support enabled
  • FreeType Linkage with freetype
  • FreeType Version 2.1.9
  • T1Lib Support enabled
  • GIF Read Support enabled
  • GIF Create Support enabled
  • JPG Support enabled
  • PNG Support enabled
  • WBMP Support enabled
  • XBM Support enabled

The first line shows, that the extension is enabled, the second line holds the installed version. The followup lines hold information about available functionality and supported file types. For the CSS Gallery the file types GIF, JPG and PNG are of importance.
If the GDlib is not activated or these file formats are not supported, you should (on your local test environment) activate it or (on the web server) ask your hoster if it is possible to add this feature. Without the GDlib the CSS Gallery cannot be used.

 

ERROR: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 3264 bytes)

If you get this error (amount of bytes will vary) when trying to open a page that contains a gallery, the amount of memory PHP needs to create the scaled main images or the thumbnails exceeds the set maximum amount of memory a PHP script is allowed to use.
One possible solution would be to increase this amount (on your local test environment) or (on the web server) to ask your hoster if it is possible to enhance your account but - with a probability of 99% - the simple solution is: Smaller images!

In many cases images get uploaded far to large for web use. A common Joomla! template offers for a gallery in the context of the main content from 600 up to 800 pixel of width at the maximum. Images of this size can be displayed at excellent quality with - depending on the image - 50 up to 100 kilobyte. If you upload your images as they are saved from your digicam, they often come with dimensions up to 3000 or 4000 pixel of width and 3 or 4 megabyte of size.
The disadvantages of such large images are obviously: The upload takes a long time, you need a lot of space on your server and - important - scarcely any visitor is willing to wait for an image of 3 or 4 MB to load. Furthermore scaling an image offline with an appropriate program (e.g.: GIMP) gives you much better results than leaving it up to the visitors browser.

In the best case you scale your images offline to a format that exactly matches the size you are going to display them on your page (if you already fine tuned the gallery) or is a little above this size (above because browsers are still worse in up scaling images than they are in down scaling them).

By the way - doing so, the error disappears too.

 

PROBLEM: Only the code {becssg}folder{/becssg*} is shown - usage in module position

If the frontend shows the code - {becssg}folder{/becssg*} (without asterisk) - instead of the gallery, the first thing to do is to check if the plugin is activated. If it is and the problem persists, in most cases you are trying to display the gallery on a module position instead of the context of the main content.
Not all extensions, that offer to display custom content on a module position, are supporting the whole functionality of the Joomla! framework and with it the functions the plugin needs to work properly.
Up till now two extensions are reported to offer the needed functionality:

One is the module "Module: Content with Plugins", listed at extensions.joomla.org under "News Display" > "Articles Embed".
The other is the module "Plugin in Module", listed at extensions.joomla.org under "Core Enhancements" > "Embed & Include".

 


That's it! Have fun with the plugin!

If you have questions or suggestions, please use the comment-function.

If you use this extensions, please post a rating and a review at extensions.joomla.org. Furthermore I appreciate everyone, supporting me with a link back to www.bretteleben.de on his/her website. The extension itself does not produce any hidden links, eastereggs or whatever.

Last Updated on Sunday, 28 March 2010 19:09
 
Comments (59)
a dot on the upper left corner of the page
59 Friday, 04 June 2010 19:50
Amir

Hello

thanks for a fantastic gallery. I do have a problem though.
on the pages I use the gallery I have a dot on the upper left corner of the page - 100px above and 100px to the left of the actual gallery.
checking with firebug I got - #becssg_pre_7_0 {height:5px;left:-100px;overflow:hidden;position:absolute;top:-100px;width:5px;}



I managed to override the problem by adding the css tags in my template.css and  changing left: 0 ; right: 0 ;  but it worked only in a specific page (article 7 in this case).
how can I override that problem in a way it will solve it in all my galleries (I am planning on using a lot of them in the site)





this is the link to one of my pages with the problem
http://www.tradewinds.mgdesigns.biz/index.php/tradewinds/7-tradewinds-pendant
@Charles
Tuesday, 08 June 2010 21:15
A. Berger

Hi Charles!

Of course you are right.

Thanks
Andreas

Correction to File Name
Monday, 07 June 2010 19:15
Charles

Andreas wrote:


...open the file /plugins/content/becss.php...


You probably meant:


...open the file /plugins/content/becssg.php...

@Amir
Saturday, 05 June 2010 19:12
A. Berger

Hi Amir!

The plugin uses a little trick to preload the images. It places them in a 1x1 pixel div, and moves this div out of sight using an absolute position of -100/-100. In your case, the configuration of the template tells the plugin that the zero-point is not the real one at the top left of the page but the top left of the content area. This moves the preloads into sight.
To solve this, just open the file /plugins/content/becss.php with a text editor.
In line 307 replace:
$csstoinsert.="#becssg_pre_".$identifier." {position:absolute;top:-100px;left:-100px;width:5px;height:5px;overflow:hidden;}\n";

with:
$csstoinsert.="#becssg_pre_".$identifier." {position:absolute;top:-1000px;left:-1000px;width:5px;height:5px;overflow:hidden;}\n";

Save, done. You just moved the preloads from -100/-100 to -1000/-1000.

Best regards
Andreas

Caption Text Cropped
58 Saturday, 29 May 2010 12:55
Phil

Hi.

Thanks very much for this fantastic plugin. I just have one problem. The text in my captions is cropped as in you cannot see the bottom of any of the letters. Is there a way I can fix this?

The second image on the link below shows the problem I am having.
http://www.chris.host-4u.co.uk/index.php?option=com_content&view=article&id=1&Itemid=2

Regards
Phil

@Phil
Monday, 31 May 2010 19:01
A. Berger

Hi Phil!

At first - sorry for my late respone.
Second - when checking your site yesterday I noticed that you already solved the problem by showing the captions below the main image which seems to work fine.

Best regards
Andreas

Disable Links from images
57 Friday, 28 May 2010 11:51
Robin

Hi!

First of all cssgallery is an excellent plugin. it's exactly what we need!

One thing though, i can't seem to disable the links from the main photo and the thumbnail.  I've set the parameter Use links to "No"  in the plugin configuration, and have also put "links=0" into the article code.  However clicking on the thumbnails and the photo still takes you to the original photo.

The reason for disabling this is i'm using a lightbox with a custom layout for the gallery. Clicking on a link within this causes the standard layout to be loaded which breaks the content.

Thanks,
Robin

@Robin
Saturday, 29 May 2010 06:16
A. Berger

Hi Robin!

The thumbnails always link to something. They are links and the whole gallery is based on the fact that links allow to work with pseudo CSS classes (hover) crossbrowser. Anyway, if you disable the feature "Links" or just don't set links, the thumbnails link to an anchor at the top of the main image.
What the thumbnails never will do (except you explicitly told them to) is to link to the original image. The path to this image is not part of the output of the plugin. If you mean the main (large) image, yes, this is the desired behavior. The original image, no.

If you could provide a link to the page with the gallery, I will have a look at it.

Best regards
Andreas

VSIG not working when I changed the host
56 Saturday, 15 May 2010 09:41
Sukanya Swadi

The plugin worked fine at one server. But when I shifted the host, a blank page appears when the link to the gallery is clicked. No error message.
I checked, GD Library has been activated. Write permissions present for all sub folders of images/stories folder.
Could it be the php version that is not allowing the component to work? The php version, we have on the new server is 4.3.9, whereas, the version on the previous server (where the plugin worked fine) was 4.4.9

Kindly help me sort this out as this is extremely urgent.
Thanks in advance.

@Sukanya Swadi
Saturday, 15 May 2010 11:43
A. Berger

Hi Sukanya!

I suggest to go to the backend > configuration > server and increase the "error reporting level" to "maximum". This should give you an error instead of a blank page. If the GD lib is working and the used file type is supported, the error is probably caused by hitting the memory limit. The page "FAQ&Troubleshooting" deals with this error in detail. In short: Use smaller images (smaller in terms of dimension).

Best regards
Andreas

Change Text
55 Friday, 23 April 2010 14:13
Matthew

Hi.  I was wondering if you could tell me where I could make changes to the caption text size and background.  I would like to make them a little bigger.  Thanks for all your work on this great plugin.

@Matthew
Saturday, 24 April 2010 16:16
A. Berger

Hi Matthew!

The CSS Gallery comes without an external stylesheet because it makes heavy use of absolute positioning and there creates mose of the CSS settings on the fly. If your project requires changing the layout I would rather have a look at my other gallery plugin, the "Very Simple Image Gallery" (menu at the left). It comes with an external stylesheet (/plugins/content/plugin_vsig/vsig.css) and is therefore easier to modify.

Best regards
Andreas

Problems showing images
54 Wednesday, 07 April 2010 19:17
Magnus S.

Hi Andreas,


First i would like to say, that this plugin is very nice.
It is just what I've been looking for to help my family whit ther web page.
However, I have a problem with the plugin.
The first article I used the plugin, behaves just as it should, but trying on other articles, the pictures does not show. Only a blank field where the picture should have been, and below the picture name.
I have read all comments on this page, and couldn't find anyone with the same problem. That is why I hope, you can help.
If ypu have an idea, to solve the problem, I would be very pleased.


The page where the plugin works:
http://mopse.dk/index.php?option=com_content&view=article&id=47&Itemid=55
And the page where the plugin behaves weird:
http://mopse.dk/index.php?option=com_content&view=article&id=46&Itemid=57
As you can see, the last page just shows a blank space where the picture should have been and below that the filename.


Regards
Magnus

@Magnus
Tuesday, 13 April 2010 21:33
A. Berger

Hi Magnus!

The situation gets more interesting from posting to posting.

- the file type is jpg
- the GD library seems to be OK because there is no fatal error
- you say the directory permissions are fine (755/644)
- the gallery displays

but: the plugin does not scale the image.

Next (and hopefully last) try: Rename the image file. Call it "a.jpg". Maybe the blanks and special characters are causing the problem. If you want to tell a story with your image, the feature "Captions" offers more options to do so than the image file name.

Best regards
Andreas

Re re: Problems showing images
Tuesday, 13 April 2010 18:08
Magnus S.

Hi Andreas,

Once again, thank you for being so helpful :-)

I've just tried to make a new directory, with the file permissions provided by you, and I uploaded a regular .jpg image to the folder, but the error stille occurs.
The links for the web page is:
Main: http://mopse.dk
The article containing the working gallery: http://mopse.dk/index.php?option=com_content&view=article&id=47&Itemid=55
The article containing the gallery I can't view: http://mopse.dk/index.php?option=com_content&view=article&id=55&Itemid=54

Any ideas?
Regards.

@Magnus
Monday, 12 April 2010 22:07
A. Berger

Hi Magnus!

Please go on tsting with image of file format JPG (not JPG2000), just to make sure we are dealing with only one problem.
Next, please check the directory permissions of the directories you created for the images. The directories should be set to 755, the files within to 644.

In addition - even if it produces an error - if possible please provide a link to the page again. I will check it.

Best regards
Andreas

Re: Problems showing images
Monday, 12 April 2010 21:43
Magnus S.

Hi Andreas,

Thank you for your very fast reply.
Unfortunately uploading the images in .jpg does not solve my problem.
I have tested a bit further, and I see that the the images are only shown correct, when they are located in images/stories/billeder
When I use that direction, it is possible to show any picture corrrect. If I make another direction for a new gallery in another article, the error occurs.
Ever heard of that problem before?


Regards
Magnus

@Magnus
Wednesday, 07 April 2010 22:57
A. Berger

Hi Magnus!

The problem is caused by the images. The working gallery uses JPGs, the failing one trys to use PNGs. Usually the gallery has no problems with PNGs but I already had similar requests here and the images in these cases have been 24bit PNGs too and - they have been created using an update version of Adobe Creative Suite.
If you give it a try you will see that InternetExplorer (at least version 7) in not able to open the original PNG you uploaded at all. I would try to open the images with another image manipulation program, save them again and reupload them. This may help.

Best regards
Andreas

Captions
53 Friday, 02 April 2010 14:11
Mark

HI,


I found from a previous post, which I probably should have read before making a post of my own, that you must still make the original call to the gallery before making the call to create the captions.  The following code now works perfectly:


{becssg}cssgallery{/becssg}


{becssg_c}0||MyName|MyText{/becssg_c}

Captions
52 Friday, 02 April 2010 12:20
Mark

Hi Andreas,


firstly - the plugin is great and just works. Well everything apart form the captions, I just cannot seem to get them going. I have checked out Section C - Captions in the "Howto Plugin Code" but still nothing works.


Here is my code for calling the gallery: {becssg}cssgallery{/becssg} this works fine.


So if i try to put a caption on the image pic01.jpg i try {becssg}cssgallery|pic01.jpg|myCaption|myText{/becssg} and it doesn't work. Is there something I am doing wrong? Other syntax I have tried which should result in the same title and text on each image: {becssg}cssgallery||myTitle|myText{/becssg}

hat den Fehler entdeckt
51 Wednesday, 31 March 2010 22:28
Klaus

Man mussFixed Startimage aud Nein setzen, einfach und Genial.


 

so cool! Danke für diese Arbeit! Genial und schnell
50 Wednesday, 31 March 2010 22:18
Klaus

Ich habe ein kleines Problemchen... Alle Bilder sollen Namen und Text haben, haben sie auch.. nur der Text vom ersten Bild geht entweder nicht weg oder wir noch zusätzlich eingeblendet?!


Hier der Aufruf:


{becssg}kinder|caps=1||prld=1{/becssg}
{becssg_c}0|Bhutan_001.jpg|Kinder|aus Bhutan1{/becssg_c}
{becssg_c}0|Bhutan_002.jpg|Kinder|aus Bhutan2{/becssg_c}
{becssg_c}0|Bhutan_003.jpg|Kinder|aus Bhutan3{/becssg_c}
{becssg_c}0|Bhutan_004.jpg|Kinder|aus Bhutan4{/becssg_c}
{becssg_c}0|Cape_Coast.jpg|Kinder|aus CapeCost{/becssg_c}
{becssg_c}0|Elmina.jpg|Kinder|aus Elmina{/becssg_c}
{becssg_c}0|Sekundi.jpg|Kinder|aus Sekundi?{/becssg_c}
{becssg_c}0|Tongo.jpg|Kinder|aus Tongo{/becssg_c}
{becssg_c}0|Fete.jpg|Kinder|aus Fete, oder machen die eine?{/becssg_c}


Der Pfad stimmt(sonst würden die Bilder ja garnicht gezeigt...der Text wird auch gezeigt, aber der Text vom Bild: Bhutan_001.jpg geht nich wech?!


Wenn das gehn würde wow.


 

English
Panoramic Image Viewer
AddThis Social Bookmark Button
Who's Online
We have 38 guests online
Latest Items