Coder Social home page Coder Social logo

novafacile / novagallery Goto Github PK

View Code? Open in Web Editor NEW
70.0 7.0 11.0 5.64 MB

novaGallery - a beautiful and and ease to use php image gallery for your photos - flat file - no database required - modern responsive design

Home Page: https://novagallery.org

License: GNU Affero General Public License v3.0

PHP 97.74% JavaScript 0.28% CSS 1.98%
photos photogallery imagegallery gallery images flat-file php image-gallery photo-album novagallery

novagallery's Introduction

novaGallery

novaGallery is a beautiful php image gallery with the focus on your images, trimmed for ease of use and low demands on web space. You just need a webserver with PHP 7.X support. No database is required. Simple to use, easy customizable and beautiful.

Official Product Page: novaGallery.org

Features

Overview

  • Albums: Directories are rendered as albums
  • Sub-Albums: Can be used for more detailed organisation
  • Preview images for albums: Automatically generate an album preview image
  • Photo overview: All photos are displayed sorted by creation date or name
  • Lightbox: View your photos in large format, hiding everything that is distracting
  • Slideshow: All photos in an album, can be displayed and presented via click (or keyboard) in the lightbox view
  • Use your own upload method: Simply upload the photos into the gallery folder (e.g. via FTP) and the photos are already online
  • Thumbnails: Automatic generation of thumbnails
  • File compression: Photos with high file size, are automatically compressed with very little loss.
  • JPEG & PNG: JPG and PNG images are supported.
  • Custom Themes: With just a little knowledge of CSS and HTML, the look can be customized.
  • Languages: You can run the gallery in your langauage
  • Private Mode: You can set a password to protect your gallery from public access.

Screenshots

novaGallery Home novaGallery Album novaGallery Lightbox novaGallery Private Mode

Demo

Requirements

  • Apache web server or similar
  • Apache: enabled mod_rewrite and .htaccess support
  • Other webserver: Individual settings in config to route all requests throw index.php
  • PHP 7.X
  • PHP-GD Extension
  • PHP Exif Support

Setup

Installation

  • Download latest version: Download novaGallery (latest version)
  • Unzip files
  • Upload files to your webspace
  • Copy nova-config/site.example.php to nova-config/site.php
  • Edit the config in nova-config/site.php
  • Upload your photos into galleries
  • Enjoy your new photo gallery

Configuration

  • Every folder in galleries is a gallery
  • In nova-config/site.php you can change some basic informations, image sizes and cache settings
  • That's it :-)

Configuration for Installation in Subdir

  • Set RewriteBase in .htaccess (RewriteBase /subdir/)
  • Set url in nova-config/site.php with full subdir path

Manage Images

  • Add Photos: Just upload the new photo to the server into the correct album (e.g via FTP)
  • Delete a Photos: Just delete the photo at the server. To save web space it's recommended to delete the cached files also.
  • Delete an Album: Just delete the whole album (directory) at the server
  • Reset Cache: Every album has a cache directory. Just delete this directory.

Themes

  • Two basic themes are included: novagallery (default, dark) and novagallery-light
  • To change the theme, just change the theme name in config/site.php
  • Creating a new template is quite simple and works with basic PHP without any extra template engine.
  • To create a new template, the basic template (based on Bootstrap 4) can be duplicated, customized and activated in the settings.

Languages

  • Some populare languages are already added (English, German, Spanisch, French)
  • Set your language in nova-config/site.php
  • You can create easily your own language. Just copy one of the language files, translate it and save it with your language code
  • It would be nice, if you let us know if you created a new language file. Just send us a message or create a pull request.

Private Mode

  • In nova-config/site.php you can set a PHP password hash
  • The password hash has to be created with the standard PHP function password_hash()
  • If you can't generate a password hash by your own, you can use our password hash generator: Password Hash Generator

Nice to Know

  • Supported images: JPEG & PNG
  • At the first time an album is opened, the thumbnails are generated. This may take a little time. After that the cached images are used for each visit.
  • If you don't use an apache2 web server with .htaccess support (e.g. nginx), you have to set the required rewrite rules from the .htaccess file at the webserver config

Troubleshooting

  • If thumbnails and images are not generated, in most cases it's missing mod_rewrite or htacces support

Support

Support Development: Pro Version without contribution

  • To support the development you can buy the Pro version for only $15. This contains exactly the same features as the free version but the mention of "powerd by novaGallery" in the footer is no longer required. In addition, every Pro Version user has the possibility to receive personal support via email.
  • Get the Pro Version: Buy novaGallery Pro Version

Contribution

We are open to ideas, improvements and bug fixes. Just create a pull request with your improvements and optimizations. If everything is okay and it fits to our product vision, we will be pleased to merge it.

Used Packages

We are very grateful to the creators of the following great packages that we use for novaGallery:

Copyright & License

  • All rights reserved by novafacile OÜ
  • License: GNU Affero General Public License (A-GPL 3.0)
  • To remove all public copyright & "powered by" mentions, you can purchase a life time license on novagallery.org for only 15,00 €.

novagallery's People

Contributors

david-novafacile avatar hija avatar robsd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

novagallery's Issues

404

I'd like to use novaGallery, because the design sounds the best. As far as I know, my server has the requirements. I copied site.example.php into site.php, edited it, put my art in galleries/, but index.php says like '404 / Page Not Found Sorry, this pages does not seem to be available' (it should be 'this page does not seem available' or 'these pages do not seem available.' by the way.) Does it just take a while to generate thumbnails or maybe did something else go wrong?

errors on start

All like in instruction :)
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in D:...\root\test82a3\src\nova-base\core\Site.php on line 23

Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in D:...\root\test82a3\src\nova-base\core\Router.php on line 47

  1. folder directory -> "test82a3"
  2. inside only your scripts -> 2 folders: src & docs
  3. pictures are inside folder "src/galeries"
  4. index.php -> "src/index.php"

Would there be a chance to change the script configuration? it would be nicer to post photos this way. And "Artist - Album" like "Author - Book title"

main folder (test82a3)
A / (artist name) / Artist - Album / (songs)
B / (artist name) / Artist - Album/ (songs)
C / ect.
....
Z

.htaccess
index.php
src/docs
src/nova-base
src/nova-config
src/nova-languages
src/nova-themes

About the possibility to download the original picture.

Hello there,

I have just found your gallery and looks wonderful! I tried Piwigo in the past and presently live on Lychee

I have a question on the download of the original photos.

I uploaded a set of photos (around the one hundred KBs only, small photos, coming from Whatsapp) and I see that when I view the gallery I am shown the 2000 (configurable) pixels size ones, with the possibility to download the cache ones at those 2000 pixels which are bigger both in dimensions and in KB than the original photos. Is there a way (other than manually going to URL/galleries/folder-name/ and downloading them by right click) in the gallery to download the original photos or even the whole folder?

Thanks for your work!

Not closing PHP ?> is considered better practice

Hi there,

cool tool.
Seems to be just as much as needed to have a gallery. I like that style and love that I am able to get every line of the code as it is few enough lines to understand everything.

A small hint:
Not closing the PHP tags is considered better practice as it avoids the risk of having whitespace after them.

error in terminal w/ 404

127.0.0.1:43406 [404]: GET /galleries/2013/07/20/cache/2000/IMG-2013-07-20-WA0009.jpg - No such file or directory

why is this happending?
my images is not loading im my local host

Protect every album

Hi there,

am i missing something or isn't it possible to protect each album with password?

Stefan

Adding Italian Messages...

To avoid merge problems... I created as issue...

if you want to add Italian messages, here is the file it.php

{
"login": "Iniziare sessione",
"logout": "Terminare sessione",
"password": "Password",
"back": "Ritorno",
"404-/-page-not-found": "404 / Pagina non trovata",
"sorry-this-page-does-not-seem-to-exist": "Ci dispiace, questa pagina non sembra essere disponibile.",
"back-to-home": "Tornare alla pagina principale"
}

Very good work !

while.... Merry Christmas !!

Cannot make it work under IIS

Testing to include the innovagallery within my web application, running IIS on localhost.

First issue was in Router.php, since $_SERVER['REQUEST_URI'] does not exist when using IIS. Fixed that.

In site.php, I set url = "http://localhost/my-web-app/novagallery" - is that correct?

Now all I get is 404-page not found.

Has anybody run this under IIS?

BR Dan

Different folder for pictures

First of all: thank you for Novagallery: very beautiful layout.
Maybe I missed it, but is it possible to point to a mounted folder, containing the folder structure of the pictures, other than the ‘galleries’ folder? I couldn’t find it in the config file.

No Cache Files created

The system does create the cache folders but no subfolders ("400x400" for example) or any cached images.
The thumbnails are not shown and only the images themselves work when opened.

Apache2 server running PHP 8 with GD support and Exif enabled.

Why does the system not create any thumbnails?

404 error running rapberrypi debian 12

after installing I am getting 404 error - now I think this is Apache being slightly different build for raspberrypi.

my error log says:

PHP Fatal error: Uncaught Error: Failed opening required 'nova-themes//index.php' (include_path='.:/usr/share/php') in /var/www/mysite.com/public_html/content/gallery/nova-base/core/Template.php:15\nStack trace:\n#0 /var/www/mysite.com/public_html/content/gallery/nova-base/app/router.php(38): Template::render()\n#1 /var/www/mysite.com/public_html/content/gallery/nova-base/core/Router.php(136): {closure}()\n#2 /var/www/mysite.com/public_html/content/gallery/nova-base/app/router.php(42): Router::run()\n#3 /var/www/mysite.com/public_html/content/gallery/nova-base/init.php(60): require('...')\n#4 /var/www/mysite.com/public_html/content/gallery/index.php(11): require_once('...')\n#5 {main}\n thrown in /var/www/mysite.com/public_html/content/gallery/nova-base/core/Template.php on line 15

my htaccess file is as follows

`
RewriteEngine on
RewriteBase /gallery/

Deny direct access to the next directories

RewriteRule ^nova-config/.$ - [R=404,L]
RewriteRule ^nova-base/.
$ - [R=404,L]
RewriteRule ^nova-languages/.*$ - [R=404,L]

All URL process by index.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [PT,L]

Deny direct access to the next directories

RewriteRule ^nova-config/.$ - [R=404,L]
RewriteRule ^nova-base/.
$ - [R=404,L]
RewriteRule ^nova-languages/.*$ - [R=404,L]

All URL process by index.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [PT,L]`

the issue I think is that the everythings needs to see files in the /var/www/mysite.com/content/gallery to function as it is a self contained environment, but raspberrypi version of apache redirect us to /usr/share/php

how can redirect it to look in the right folder path

please note this is a completely fresh instal - i am also seeing similar errors using budit

404 /page not found

Hi David, thanks for sharing your work, unfortunately I can't get it to work after hours of trying.
Apache2 document root = /var/www
I downloaded, placed the .zip on the server and unpacked it there. Moved the files into
/var/www/novagallery and put some jpg in 'galeries'
I have in site.php "url": "https://mysite.com/novagallery/" which should be correct.
get 404/page not found
Now i put in site.php "url": "https://shit.com/novagallery/"
just before router::run i placed echo "BASEPATH = " . BASE_PATH;
In both cases i get:
pic1
So it makes no difference for BASE_PATH what url i provide, as long as the directory is correct?

I experimented with hardcoded router::run's, like Router::run("https:/mysite.com/novahaha/"); i get also the black page , strange.
But what page cannot be found? Because untill router::run everything works. What should BASE_PATH look like, in my case?
What should be the privileges of the .php files? Maybe these are corrupted. Should they be executable for everyone? Currently the owner is root who is the only one who can execute.

apache error.log : [Fri Aug 19 22:50:56.113775 2022] [php7:error] [pid 320] [client 192.168.0.201:52558] PHP Fatal error:
require(): Failed opening required 'nova-themes/novagallery/index.php'
(include_path='.:/usr/share/php') in /var/www/novagallery/nova-base/core/Template.php on line 15

I hope you can make something out of this.

Very nice web ui for sharing home photos, do you know something similar for videos too?

Thank you for the excellent work ...

I found a small bug when there are two empty albums in path and then there are pictures in the next album, so the paths to them are somehow poorly indexed. When I removed the empty albums in the path, everything is fine. I don't know at all if I would be able to replicate it accurately though.
So just a question from the headline: does anyone know of a similar piece for video sharing? Or would it be difficult or bold to ask to improve novagallery with this feature? :-)

Image/Thumbnails in cache not being created

Hi,

Have installed on local apache server PHP7+ and installed ok/updated init.php, .htaccess etc.

Home page loads but images/folders do not show up and right clicking on image placeholders says path is 'galleries/cache/400x400/' + [image1.jpg]/[image2.jpg] etc. (the test images I put in galleries)

The folders show up as '/album/albumA/' , /album/albumB/' for the two test folders I placed in galleries.

Looking in 'cache' folder there is a 'files.php' file that has been created and contains image refs but no '400x400' folder and cannot see an 'album' folder?

Also clicking on the placeholders launches the slideshow (can see left/right arrows etc) but no images again.

Hopefully can help!?

Many thanks.

Plus sign in gallery folder name -> 404 error

When creating a gallery with "+" sign in its folder name (e.g. "Me+you"), the album page returns 404 error.

The error comes from Router.php class where urldecode is used on line 70:
$path = urldecode($path);

How to don't create imageSizeBig ?

Hello,
Thanks for your great code, it's very nice.

I have a problem: when I click on an image (to see it on the lightbox), it creates an image with the dimensions indicated in "Site.php", in the "imageSizeBig" parameter. And so, this fills the cache folder.

I don't want to generate a new version of the image here, but just display the image stored in my source folder, whether it's really too small or really too big.

Is there a way to have this behaviour?

Difficulties installing in Rocky linux

Rocky Linux 8.5 fully updated.
Installed httpd, php, php-json
Extracted contents of novagallery to the /html default apache path, not as a sub-directory.
Renamed and edited site.php file with URL=http://192.168.0.54 (IP of temporary server)

When accessing the site, I am seeing the basic novagallery page with broken images for gallery place holders (for the image directories), but titles of those directories are showing. When I click on any of them, I receive a 404 error.

I'm able to navigate directly to the images and view them singly via a web browser. A simple php script to display the contents of one of the galleries also shows all the pictures in one of the directories (granted, with no thumbnails or resizing).

Looking for pointers
novagallery_error1
novagallery_error2
.

Album ordering malfunctions when album is composed solely of more albums

Problem

Album ordering is not as expected.

Issue

Albums that are composed solely of sub-albums (that is to say, the album does not have any direct image descendents) cannot extract a modification time, because it's expecting at least one image in the level below it.

Solution

Easiest way to get around this is just to keep at least one image in the album itself.

The logic for obtaining album $modDate should recursively access modification times to order albums if there do not exist any images in the level directly below it. I suspect it might be done here;

$orderedAlbums[$album] = '';

Instead of returning an empty string, it might dig down to the first album that has images as a direct descendant. I might work on this but again I'm not great at PHP so it would take me a little longer, and this seems like a relatively simple fix.

Details

I have debugged this issue by placing the following code in the nova-themes/novagallery/home.php file, around line 17:

<div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-5 element">
  <a href="<?php echo Site::basePath().'/album/'.$elementPath; ?>">
    <img src="<?php echo Image::url($elementPath, $gallery->coverImage($element, $order), Site::config('imageSizeThumb')); ?>" loading="lazy" class="rounded"><br>
    <?php echo ucwords($element . " MOD: " . array_values($modDate)[0]); ?> <!-- <----------- added this line -->
  </a>
</div>

It displayed a missing $modDate for the out-of-order album:

image

I suspect when it goes to get array_values($images)[0], it is expecting that at least one of the values in the array is a timestamp. But if all the elements of the array are albums, then the value isn't a straight time-stamp value, it's a key-value array of more images. To test this theory, if I placed at least one image in the out-of-order album, then it should reflect a correct modification time -- and it does.

image

Notice the 2015 album now has a value for $modDate and is ordered correctly.

The logic here therefore should recursively access modification times to order albums if there do not exist any images in the level directly below it.

Sorting options

I see in the description that galleries and images can be sorted by date or name, but what are the other options to put in the setup.php file to get the different sorts?

"sortAlbums": "newest",
"sortImages": "newest",

show file name

Hello!
I am very interested in acquiring the licensed version. Is it possible to configure so that the file name is displayed along with the photo?

installed fine but images/albums don't appear

I installed novaGallery at my homesite: it says novaGallery, and my site name, fine. I copied art into galleries/ . However albums say 404. I don't use .htaccess (I'm administrator) rather than main configuration (so don't know I need RewriteBase or what it is.) It's only an Arm CPU server so might take long to generate thumbnails, but I might move to a x86 CPU server.

Configuration

Need help with how to set URL in site.php. Keep getting message about site can't be reached...check if there is a typo in https. Can somebody please provide a sample URL entry?

Currently my entry looks like: "url": "https://xxxxxxx.a2hosted.com/public_html/novagallery/" because I've installed Novagallery in the novagallery subdirectory of my public_html page.

Or suggest what else I should look at?

Thank you!

Custom album naming?

Hello, great gallery and simple to work with, but when I try to use special characters(our language use a lot of those) in album's folder name, the name of the album ends up all messed up and the thumbnail picture doesn't show up and the link might not work(can't remember, tested it some time ago) Is there some fix to it, I'm a beginner in php, I know html better. It is something to do with text formating, since it wont show any special characters that you are able to use in folder names like áéíóú etc. The best thing would be to add and extra php line where we could set our own 'album title' and show that instead of folder's name.

Shuffle Sort

Is it Possible to Shuffle Gallery? Which File should be modified zu shuffle Fotos in a Page?

Intended use of URL field?

Hi,
I just installed this gallery on my home server. What is the intended use for the URL field, if, for example, I want to test this on the LAN only?

Thanks
R

Number of albums limit?

I was wondering if there is a limit on the number of albums/sub-albums you can have?

I recently setup novaGallery and got it working well. I initially uploaded 3 albums, 1 of which had 2 sub-albums, and all looked well. I then proceeded to upload a Gallery structure with 11 main albums, but 327 total albums with 29682 image files. But I only get the 3 original albums. I tried deleting all the caches, that didn't help. I then moved all the albums out of the galleries folder and cleaned up all the cache files. While they were gone novaGallery showed an empty page. I moved 1 album back in and it showed the 1 just fine... I then copied all of them back and once again it only shows 3.

I have another site I setup that only has 3 main albums, but has between 18 and 25 sub-albums in each of those main albums and it is working just fine.

So I'm wondering if I am limited to 3 main albums?

404. always

I seems followed all your explanations, but it keeps giving me 404. always.

Automatic refresh of list of photos

Hey!
First of all thanks a lot for this tool! I love using it.
In my case I now plan to use it for a Photo Booth to display the photos taken.
Is there a way to automatically reload the list of photos without reloading the complete page and without kicking away the Lightbox?

Thank you already for your work until now!

configuration for nginx

It would be useful to include in the documentation the configuration for nginx (i.e. the equivalent entry to include in the sites-enabled default file, which I understood should include the rewrite information instead of the .htaccess file used by apache).

Being new to this, I used an online converter, which gave me the following:

nginx configuration by winginx.com

location ~ ^/photos/nova-config/.*$ { }

location ~ ^/photos/nova-base/.*$ { }

location ~ ^/photos/nova-languages/.*$ { }

location /photos/ {
if (!-e $request_filename){
rewrite ^/photos/(.*) /photos/index.php break;
}
}

I included the above in the NGINX default file of the sites-enabled diectory, however it doesn't work. (I get a 403 Forbidden error when trying to access the photos directory). PHP itself is set up correctly, according to tests, and the php.info file loads OK under NGINX.

gif?

Hi, is gif support possible?

thank you in advance ;)

Album names use ucwords()

Album names use ucwords() for uppercasing its name in displaying to users.

I suggest to make this optional via config file.

In my language (Czech), we don't use uppercasing for first letters in headlines and it seems weird then.

Include subtitle or small description of album

Hallo, very nice product you have.
After a long search I found your product which fulfill my needs.
I have a small question / enhancement. I see in your code that you use the variable subtitle. Can I use this variable to give a small description of the album? Or is it possible to add an extra variable album-description to present a small description of the album in the website. Thanks.

image size

I noticed that it's useless to lower the "imageSizeThumb" below "200x200". I hoped to get more thumbs but they are only stretched to fit 4 in a row. So 4 thumbs seems the max in a page row.

As for a mobile page the max seems to be 1. This makes the concept of thumbs pointless because the thumb is streched to page width (and blurred) and when clicked we get an even smaller photo.
Is there a way to tweak this?

404 / Page Not Found

I recently bought a Pro Version of Nova Gallery but when I put them into test using XAMPP running on my windows machine, it always encounters the same error no matter how hard I try to resolve this issue. Kindly, help me out with this.

image

Adding the file name in the theme

Hello.
This gallery is really simple and efficient.
But I've a problem : I need to have the name of the files under the thumbnails in the album page (http://novagallery.pierrebehel.com/album/2023-09-02_amboise) under each picture and also in the full page picture (http://novagallery.pierrebehel.com/album/2023-09-02_amboise#pid=9).
How am I abble to do that ?
I've bought a Pro Version.
I'm not a developer but I can open a PHP file and modify it after having duplicate the theme folder with a new name. I've modified the configuration without problem.
Thank you.

multiple users / passwords

Is it possible to have multiple users / passwords, love the gallery and like the login process, but would like to be able to have the ability to add additional users / passwords.

Enhancement: define location of cache & thumbnails

It would be nice if the gallery could be used to display photos on a Read-Only medium. This can be achieved if files created by the gallery can be (by configuration) outside of existing album structure. maybe even on /tmp (which would be slow, but that would be the choice of the user).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.