Outils pour utilisateurs

Outils du site


MiniGal Nano (modified)

(Version française de ce document)


MiniGal Nano is a very simple image gallery. It only requires php and GD (no database, no special libraries like PEAR or ImageMagick). MiniGal Nano does not have a web admin interface: You only have to drop your images in the photo folder.

I am not the author of Minigal Nano. I have modified MiniGal Nano to fit my needs (in particular my galleries). (The original website was minigal.dk)

  • List of changes:
    • Added a thumbnail cache (to reduce server CPU load and increase page display speed).
    • Added gallery comment (just create a comment.html file in each directory).
    • Added comments in the three base templates (mano,exhibition,integrate).
    • Adapted the darkgold2 template from 0.2.3 of MiniGal Nano.
    • Changed the default configuration file:
      • darkgold2 is now default theme
      • changed the number of thumbnails per page ($thumbs_pr_page).
    • Disabled new version check.
    • Corrected a XSS vulnerability in the original version 1) (thanks to John JEAN).
    • RSS feed.
    • Many other features (see GitHub).

Original official website seems to have vanished. Developement of this version is now hosted on GitHub.






  • Unzip the archive and transfer to your web host.
  • Copy your photos in the photos subdirectory.
  • You're done ! Your gallery is browsable.

Note: Depending on your host, you mave have to remove the .htaccess files (Some hosts do not support some Apache configuration instructions.)


  • Title: In config.php, change the line $title = "My Gallery";
  • Author: In config.php, change the line $author = "Me :)";
  • Number of thumbnails per page: In config.php, change the line $thumbs_pr_page = "21";
  • Folder icons: If an image folder.jpg is present in a folder, it will be used as folder icon.
  • Comments: If a file comment.html is present in a folder, it will be displayed above the thumbnails.
  • Template: In config.php, change the line $templatefile = "darkgold2";
    • Available templates in version 0.3.5 are: darkgold2, mano, exhibition.

If you need further customisation, you can create your own template. Start by duplicating one of the existing templates in the templates directory, then alter the CSS (which is included in the HTML file).


Creative Commons License
MiniGal Nano SSE by Sébastien SAUVAGE is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at www.minigal.dk.

This vulnerability is not corrected yet in the genuine version of MiniGal Nano.


opeter, 2011/02/09 12:46

Thank you so much for you excellent modification! Regards, Peter

Sébastien SAUVAGE, 2011/02/20 22:32

Thanks :-)

Hoi, 2011/10/02 03:46

How can I set the thumbnail folder to a specific folder? eg. ”/thumbs” instead of having it in my gallery root?

Sébastien SAUVAGE, 2011/10/04 22:10

Use the source, Luke ! :-) Look into the createthumbs.php file, lines 57 and 61.

Mitchell, 2011/10/21 02:24

Firstly I want to say its awesome that this caches the thumbnails, the original version was really slow. Ive set the page width to a percentage, but this makes it so there is sometimes rows of thumbnails that arent full. Is there a way to set the amount of images on a page to a number of rows instead of a definite number?

Mitchell, 2011/10/27 12:58

After thinking about this it isnt really the best solution. Is it possible to just show everything? Ive tried using 0 and -1 but it doesnt show anything

Marc, 2011/11/10 11:25

Hi, it does not create the “cache” folder.

i set permissions even to 777 for the photos directory… no sucess :(

any clue ?

Mitchell, 2011/11/21 00:55

Is there a way to stop the images being downloaded? Its good that you cant right click, but the links point at the actual location of the pictures, making it easy to download them. Is there a way to protect them? I tried using .htaccess files but it causes the images to not load

Mitchell, 2011/11/21 00:56

Is there a way to stop the images being downloaded? Its good that you cant right click, but the links point at the actual location of the pictures, making it easy to download them. Is there a way to protect them? I tried using .htaccess files but it causes the images to not load.

Marc, are you sure theres supposed to be a cache folder? I dont have one

Sébastien SAUVAGE, 2012/01/30 14:50, 2012/01/30 14:50

You can't prevent bits to be copied, like you can't prevent water from beeing wet. Nobody can.

NicotineLL, 2012/01/25 01:38

Hey, what's up,

I just want to say that you did a pritty good work! Love it. Only problem - images are cached in a single folder. Most servers will only row 2000 to 4000 files in a query so it will be impossible for them to be downloaded (in case somebody wisesh to save their cache). I've made some changes to the createthumb.php so every thumb goes in a directory same as the album/image (or mirror cache if you'd like).

Anyway, check it out here - http://demirevdesign.com/public/createthumb.zip

You can add it to your changes.

Sébastien SAUVAGE, 2012/01/30 14:51

Great ! Thank you.

And you are right: so many files in a single folder will probably slow things down. Thanks for the patch.

Mitchell, 2012/02/08 09:26

Well maybe I just dont understand it fully but what i mean is how you can deny access to other directories like the thumbs with Deny from All in a .htaccess but you cant with the actual images. So am i right in assuming that the javascript accesses the images directly from where they are stored on the server while the php that shows the thumbs does it in a way that doesnt return a 403? Why cant they both do this? I'm just trying to stop spiders downloading all the images.

(oh and btw this is really confusing if you dont speak french. but i know now from elimination)

Sébastien SAUVAGE, 2012/04/05 11:05

As far as I know, the javascript links directly to the images, hence the problem if you try to proctect with htaccess. But even if you change MiniGalNano so that images are downloaded by a php script, spider will still be able to download them.

Redux: If a human can see the images in the browser, the bots can download them. There's not much you can do about it.

Converse Star, 2012/04/14 09:34

Converse Sko : http://www.conversedk.com/ Converse has worked with Nintendo art before with the Super billage converse : http://www.conversedk.com/converseallstarhi-c-5 Mario Bros. Chuck Taylor Hi sneakers, and the two companies will be Converse All Star : http://www.conversedk.com/converseallstar-c-3 working together again in Japan. Coming in both black and white, the new Super Mario Bros. OX shoes will be available in the spring of this year. Converse Star : http://www.conversedk.com/

Nike Free Run, 2012/04/14 09:35

nike free billig,http://www.nikefreerunda.com/ Nike Free Running,http://www.nikefreerunda.com/ nike free sko,http://www.nikefreerunda.com/ Nike Free Run,http://www.nikefreerunda.com/ Nike Shox,http://www.nikefreerunda.com/ Nike Free ,http://www.nikefreerunda.com/

Nike Free Run : http://www.nikefreerunda.com/

Chanel Handbags, 2012/04/14 09:35

Chanel Handbags Blog. Chanel Handbags : http://www.chanelgreece.com/ Chanel: http://www.chanelgreece.com/chanel-handbags-c-4.html The softest leather in the world is used for producing Chanel purses. So when you get one make sure to have a leather cleaner and moisturizer to keep your handbag fresh. Chanel Handbags Blog.

Michele, 2012/09/11 08:13

Great!! You save me, this version is really very fast!

Enrico Luisoni, 2012/09/14 14:49

Hi, do you know the trick, to get rectangle thumbnails in place of squared onces ??


Mikolaj Karolczak, 2012/09/18 23:19

Hi! I installed this version of Nano but I am also having the problem with missing thumbnails. The gallery shows just the “Loading…” text. It works quite randomly - if I refresh the page, another thumbnails are not displayed. Could you please advise on any other setup that needs to be done. Or, perhaps, it may be a server issue?

MT, 2012/09/27 16:31

Thanks for the script, it's great. Could the same technique be applied to the images themselves? I would like to be able to upload full-size images, but to only send an 800x600px (or so) picture over the wire to the user, but not have to do the processing for that resizing every time someone views a picture.

MT, 2012/09/27 20:51

I went ahead and implemented what I was asking for … my version now resizes everything that is shown in the lightbox as well, as well as caching it (using the same createthumb.php as fo the thumbnails). It also places the cache in folder structure by 'thumbnail' size and origin folder (within the thumbs folders), and the preview can be configured to scale proportionally rather than output a square (needed for the lightbox resize).

It works really well, since the lightbox prefetching triggers the generation, so it feels pretty fast, even the first time.

KKO, 2012/10/15 20:47

Hello MT, Can you public your version?

KKO, 2012/10/15 18:17

Hi MT. can you share your version?

MT, 2012/10/15 21:52

Hi, it's not quite ready for public distribution, but if you'd like me to email you a copy, send me an email (to nano@zulutime.net).

MT, 2012/10/19 19:09

Hi again, KKO and others,

I've finally packaged my version of MiniGal nano. It seems the changes have actually added up a bit:

  1. Added dynamic, cached, resizing to lightbox version of pictures (not just thumbnails)
  2. Resized versions are served directly by apache (not passed through a php script every time)
  3. Changed thumbnail generation to use phpThumb, which allows for better handling of large photos, as well as files with minor errors/problems. Using phpThumb for the actual thumbnail generation also simplifies the code in createthumb.php considerably.
  4. Added slideshow option to the lightbox (by pressing spacebar). Great to view photos at your leasure or to trigger caching of all photos in your album.
  5. Improved EXIF usage to display EXIF captions and date taken in the lightbox.
  6. When sorting images by date, this version uses the EXIF date taken, rather than the date when the file was modified.
  7. EXIF info is now also cached

This can be downloaded from:


Current version is MiniGal-nano-Zulu-0.3.5.SSE2.Zulu.4.tar.gz

Comments are appreciated, and can be sent to nano@zulutime.net

TC, 2013/03/17 13:56

I uploaded your script to my server, changed nothing, but all I get is a white page…

Desi, 2012/12/11 14:32

Is there a way that I can ENABLE right clicks? In this case, I want to allow people to download images.

Stef, 2013/06/26 21:29

Yes you can enable rightclick. In the mootools.js, deactivate the following lines and it should works.

if (type.test(/DOMMouseScroll|mousewheel/)){ var wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3; } var rightClick = (event.which == 3) || (event.button == 2), related = null;

Cochise, 2013/08/09 15:01

Hi Stef, If i do that the lightbox is not showing anymore… I just want to allow the right click but keep all the other functions. Do you know how to do it ?

Or better, if someone know how to add a button under the picture in the lightbox who copy the path of the picture in the clipboard it should be great !

Bob, 2012/12/29 06:46

Is there any way to add a short description or the filename under the thumbnail so people know what the picture is before viewing it in the lightbox?

Many thanks!!

papy, 2013/01/29 20:11


connaissez vous un équivalent pour les vidéos ?


Seb, 2013/02/18 10:23


I've patched your version a bit so that it works with folders that have ' in their names - simple patch that I just replaced src='…' with src=\”…\” and same for href…

Might be worth including this; drop me an email if you want the patch :)

Cheers for your changes!


Danish Fayaz, 2013/03/25 10:45

I am using minigal nano 0.3.6 version. The gallery thumbnails are not visible they appear to be borken in my local wamp. When I uploaded all the files to my one server they were working fine. But when I shifted them to another server the thumbnails are giving the same error (broken/not being loaded). Please can anyone tell me what's causing this issue?

MT, 2013/03/26 17:22

Seb: Assuming you were addressing me in your 2/18 post, then yes, a patch would be great. I went ahead and created a GitHub repo for this project. The current version (2013-03-26) should be identical to the one that is available on my website (MiniGal-nano-Zulu-0.3.5.SSE2.Zulu.4.tar.gz). If you have a patch against the GitHub repo I should be able to apply it and publish the updated version relatively quickly. You could of course also clone the repository, apply the fix to the clone, and then send me a pull request. The repository URL is:


It is straightforward to clone this repository using git, but anyone who does not have git can download the most recent version from:


Since the project is pure PHP there is no compilation anywhere, so this is a completely ready-to-install package. Just put the “nano” folder from the downloaded zip file on your server to install. (I would appreciate feedback, either on this page or on the GitHub page if that is not the case).

MT, 2013/03/26 17:28

Daniel: The thumbnail generation depends on either GD or ImageMagick being installed on the box that is serving the PHP files. My guess is that one of your servers has either of these programs installed but the other server (and your local desktop) does not have them available.

Emanuel, 2013/03/30 19:41

I want to ask, if anybody has an idea, how to rewrite the urls with htacess of minigal? So that ”/?dir=Whatever” is shown as ”/Whatever.html” or simple as ”/Whatever” or similiar?

Jhod, 2013/05/14 22:22

Can someone explain how to use the new label feature, i can not get it to work even with the label set.

Vladimir Vasilev, 2013/05/23 02:41

HI I would like to make all the thumbs portrait size and the landscape photos to be copped according to the portrait size.

Mike, 2013/06/21 21:13

There appears to be a bug with the integrate.html template currently on Github. Using integrate.php to embed a Nano gallery in a web page results in no thumbnails and no images being found. The same gallery displays perfectly using index.php. Comparing the two, it appears GALLERY_ROOT is inserted into a string in the wrong order.


Default gallery creates this link: http://website.com/nano/createthumb.php?filename=photos/001-1.jpg&size=800&square=false

Integrate creates this link: http://website.com/createthumb.php?filename=nano/photos/001-1.jpg&size=800&square=false

Note “nano/” is the placed correctly in the first before ”/createthumb.php” but incorrectly in ”?filename=nano/photos/”

I have yet to identify where this is occurring as I would like to fix it. Has anyone else fixed this on their own yet?

fbk, 2013/06/26 16:26

Hi, is there anyway to display and allow downloading of the original photos?

Also, is it at all possible to allow the listing of video files, so they can at least be downloaded?


frit, 2013/07/28 01:27

im having problem, it doesnt create thumb when i upload big images. like 7MB and UP..i tried both version ZULU and SEE.


KungFuMunchkin, 2013/09/10 05:58

I could need your help regarding fetching information for the “latest Pictures” and show them on a different part of the page.

For example if I would like to show the 5 latest Pictures added to the gallery on the front page.

Any idea how I should go about that the easiest way?

Bill, 2013/10/07 22:29


I think I have found a bug as I downloaded the latest version of from github, and I can't get the other themes to work with it. The only theme that works is the zulu. Also on the zulu theme the selected folder.jpg images do not show up. Anybody know how to fix these problems?


Roland, 2013/10/16 10:43


Works real fine except captions. I have such lines in it : assemblee-nationale.jpg|Les députés dans l'hémicycle de l'Assemblée nationale But I can’t make them appears at the bottom of the snaps. Only the file name is visible.

What should I do to make them apppear?

Thanks for your reply.

Lucas-C, 2014/07/16 09:15

@Roland: a commit was just merged into the Github repository to fix this:


MaikT, 2015/08/10 13:59

how can i change the size of the pics when u click on a thumb? theyre so small…

thumbs are big and pics are small. want the opposite.Gras

Fatboy92, 2015/09/11 21:06

Hi all,

seems like not much is going on any more on this page, but I'll try.

This is real nice a piece of software, so before I ask for help, here are my thanks.

So, I have installed the version from git and most people seem to have trouble with the thumbnails, but not I. I don't get the full pics when clicking on the thumbs m(

So if anyone has an idea on this I would be grateful.

Good night Fatboy92

BHY, 2015/09/24 22:44

I have try to add a file comment.html in my photos folder but no comment appear … Could you send me a sample of comment.html file ? how is the structure of this file ?

Sorry bt i am a junior in developpment :-)

Many thanks

Bhy, 2015/10/04 18:12

Any idées ? Thanks

D@vid, 2017/10/12 11:56

Even 2 years after the last comment, this is a wonderful piece of software :)

Exactly what I need, clean+simple, no sql-database or complicated admin frontend, very fast, feels and looks great!

Thanks to you guys: Thomas Rybak for Original MiniGal Nano, Sebsauvage+Zulu for you great modifications which make MiniGal even better!!!

I love it,


Sébastien SAUVAGE, 2017/11/20 12:11

Thanks =)

pmik, 2017/12/02 10:45

Excellent work! An nice feature to have would be the ability to precreate all thumbs with the execution of a script. It would be extremely useful for low CPU powered machines (Raspberry PI, Olimex Olixulino). Has anyone tried something like that?

Sébastien SAUVAGE, 2019/05/02 21:28


Discussion is now closed on this page.

minigal_nano_en.txt · Dernière modification : 2019/12/05 09:48 de sebsauvage