Galleria error messages

When Galleria run into problems, it will display errors in the gallery container.
Red are fatal, they will also stop the gallery script. Black are warnings.

Fatal errors will also throw an exception, causing all scripts to stop.

Tip: You can turn off all errors by setting debug to false.
If debug is set to false, no errors will be displayed and no exceptions thrown. If a fatal error occurs,
a simple ‘Gallery could not load.’ will appear, but no other scripts will be affected.
We recommend to have debug on while developing, then turn it off on deploy.

Remember that the errors and warnings are designed to help you, not scare you away. They are simply a guide to why something is not working properly.
So please, don’t panic and hit the support the first thing you do if you get errors, just read through this document and other pages in the documentation
and go through necessary steps to debug the errors. Most times it is a small mistake somewhere that is easily corrected.

This document will explain some of the most common error messages, what might cause them and what you can do if they appear.

Theme CSS could not load

Type: Fatal

This error message will appear if the browser could not load the CSS file attached to the theme when using loadTheme().
It will try for 10 seconds before displaying this error.

What you can do

Make sure that the CSS file is in the right path (inside the theme folder) and that it has the right permissions

This message appears in IE when it is in so called “Quirks Mode”. This usually happens when you have the wrong doctype.
Galleria might still function in Quirks Mode, but there is a big chance that it will look/behave quirky.

What you can do

Add a doctype and validate your page HTML.

Could not extract a stage height from the CSS. Traced height: …

Type: Fatal

After the gallery has initialized, it will make sure that the stage has sufficient height to continue the program.
It targets the stage, because this is a good way of making sure that the CSS is loaded and has applied.

It doesn’t really matter if you set width/height as options, because Galleria needs to extract computed measures.
That means that the gallery and its parents must be visible in some way, otherwise it will fail.

This message will appear if these requirements aren’t met within 5 seconds.

What you can do

Make sure that your gallery is visible so it can extract measures. If it is hidden in an accordion or inside a container with display: none, it will fail. You can try to set wait to true if that is the case.

Double-check the path to the theme CSS and make sure it works properly.

If you have made a custom theme, make sure that the stage has a height.

Make sure all elements on the page are loaded by putting the Galleria init script in a $( document ).ready(); block or the shorter version like this:

(function(){G.init();}());

Could not extract sufficient width/height of the gallery container. Traced measures: …

Type: Fatal

The gallery needs a global width & height of the container. It will try to extract them from the CSS or containing elements measures,
or from the width/height options.

If it fails to extract a width or height, this message will appear.

What you can do

Make sure that your gallery has a width and height. You can do that using CSS or by settings options. You can do that using CSS or by settings options (use max-width/max-height if you want it responsive, either one is sufficient)

See Point 4 above

Stage width or height is too small to show the gallery. Traced measures: …

Type: Fatal

Again, this is another test that makes sure that the gallery has a width/height.
Unlike the previous errors, this is specific for the stage measures, not the container.

What you can do

If you have made a custom theme, make sure that the stage has a width and height in the CSS.

Follow the same instructions as for “Could not extract a stage height from the CSS” error.

Load failed: no data found.

Type: Warning

This message appears if the data array is empty after parsing the data.
It is a common message if you are using the Flickr or Picasa plugin and the plugin fails to load a set.

What you can do

If you are using the Flickr or Picasa plugin, double check the settings and make sure you are requesting public photos.

If you are using JSON data, double-check the array and make sure it is valid.

If you are using HTML, make sure that it is properly formatted.

Theme at [path] could not load, check theme path.

Type: Fatal

If you are using the loadTheme() function, this error will appear if the theme script fails to load after 5 seconds.
This is somewhat common if you are working locally first and everything works, then when you upload to the server this error appears.
In those cases, the most common thing is that the script is not readable by the browser, so you need to adjust the file permissions on the server.

What you can do

Triple-check the theme path, also make sure that it is readable without a 403 error. You can do that easily by pointing the browser directly to the script.

Could not extract width/height from image: …

Type: Warning

Galleria loads the images and uses the width & height to calculate scaling and proportions.
If it for some reason can’t extract these measurements from the image, this warning will appear.

This was much more common in version 1.2.5, but we fixed a bug in 1.2.6 that made it appear for no reason.

What you can do

Make sure that the images are fully readable and that there is no fishy Apache-cache for images going on.

Make sure that the images are 100% valid and working.

Turn off any extensions, such as AdBlock, when debugging.

If you still get this warning, but everything seems to work fine, just turn off debug when deploying and it will be OK.

Image not found: [source]

Type: Warning

This error will be displayed if the image is not found after a couple of attempts.
It might be a 404 or something else that prevents the browser from reading the image.
You can define a dummy image that should be shown instead if this happens.

What you can do

Double check the image path.

Make absolute sure that the image is fully readable, you can easily do that by pointing your browser directly to the image.

Could not scale image: [source]

Type: Warning

This happens if the script could not read a valid width and height for the image container.
Usually, this error happens when there is a problem with the gallery CSS, and it usually comes with other errors.

What you can do

Make sure that the theme CSS is in order.

Follow the same instructions as for “Could not extract a stage height from the CSS” error.