Single File PHP Gallery Version History

Single File PHP Gallery 4.11.0 (6-october-2022)


  • Added option to extract and show PNG text chunks information
  • Fixed handling of images with corrupt EXIF date information

Single File PHP Gallery 4.10.0 (10-may-2022)


  • Added zip option to allow download of galleries as zip files. Zip option is disabled by default. See zip section in readme.txt for configuration options
  • Added detection of inaccessible GALLERY_ROOT. Script will show an error message if GALLERY_ROOT is inaccessible
  • Added TEXT_DAYS option, to allow setting localized representation of days
  • Added TEXT_MONTHS option, to allow setting localized representation of months
  • Other minor fixes, changes and enhancements

Single File PHP Gallery 4.9.0 (26-feb-2022)


  • Enabled script to be fully configurable from a wrapper file. See new section in the readme.txt: "USING A WRAPPER FILE"
  • Moved SECURITY_PHRASE to a separate file in the DATA_ROOT. See the "SECURITY_PHRASE" description under the DATA_ROOT option
  • Added functionality to allow download of files stored outside web root (when GALLERY_ROOT is set to an absolute path)
  • Added TEXT_INFO_LABEL option to allow setting different text on the information box and information button. TEXT_INFO_LABEL can be set to '' to remove the information box from the information panel
  • Added administrator option to allow choosing an image to be used as thumbnail for the directory
  • Enhanced the HTML_DESCRIPTIONS option to allow setting a list of allowed HTML tags. It can still also be set to TRUE for all or FALSE for none
  • Enhanced the TEXT_EXIF_MAP and EXIF_MAP_LINK options. They can now both be set to '', to remove the map link in the EXIF information panel
  • Enhanced the EXIF_MAP_EMBED_LINK option. It can now be set to '', to remove the imbedded map in the information panel
  • Changed so that a space is added between each line in descriptions, when DESC_NL_TO_BR is FALSE
  • Changed all $variables in the configuration part of the script to constants, to allow overriding all options from a wrapper
  • Changed all configuration defines to use a new option function to not trigger warnings when already defined in a wrapper
  • Fixed issue where non-empty directories would also be deleted from the gallery root if the DELETE_EMPTY_DIRS option is enabled
  • Minimum PHP version 7.0 is required
  • Other minor fixes, changes and enhancements

Single File PHP Gallery 4.8.1 (14-dec-2021)


  • Fixed issue where non-image files in the gallery could make gallery not work
  • Fixed issue where description from a sub directrory could be shown in parent directory, when parent directory have no description

Single File PHP Gallery 4.8.0 (28-sep-2021)


  • If you are upgrading from an older version to this version you need to delete the contents of DATA_ROOT
  • Added EXIF GPS extraction. Latitude, longitude and a small Google map is shown in the Information box (map vendor can be changed in settings)
  • Added option (DIR_ROOT_BANNER_IN_SUBDIRS) to allow one banner file to be used in all directories
  • Added option (HTML_DESCRIPTIONS) to allow enable/disable html in descriptions and other files in the gallery
  • Added option (DIR_THUMB_FROM_ICONS_DIR) to allow setting an image to be used as thumb for all directories (override normal selection of thumbnails for directories)
  • Added options (TEXT_DIR_MARK_START and TEXT_DIR_MARK_END) to allow easy configuration of directory name representation. By default a small icon of a folder is printed in front of directory names
  • Added "i" to keyboard navigation. Pressing "i" will open/close the information box
  • Added array to define which IPTC data to include and what to call them. (Removed a lot of TEXT_IPTC_ options)
  • Changed so that EXIF box is only showed when there is EXIF information to show. (Removed setting for TEXT_EXIF_MISSING)
  • Changed so that IPTC box is only showed when there is IPTC information to show. (Removed setting for TEXT_IPTC_MISSING)
  • Changed so that Description box is only showed when a description exists for directory, image or file
  • Changed image resize and other layout related things from using javascript to CSS. Removed a lot of javascript that had to do with the old methods
  • Changed data format in both DATA_ROOT save files and javascript. This is the reason why you need to delete the contents of DATA_ROOT when upgrading to this version
  • Replaced the PayPal inventory counter with a manual "Available" or "Sold" setting
  • Removed image preview option
  • Updated script to work with PHP 8
  • Other minor changes and enhancements

Single File PHP Gallery 4.7.1 (19-dec-2018)


  • Added option "DELETE_EMPTY_DIRS" to have the gallery delete empty directories. This option is disabled by default
  • Added "Invert Selection" button in ADMIN menu. Can be used to selece/deselect all items
  • Added option "THUMB_PNG_ALPHA" to allow transparency in PNG thumbnails. The option is enabled by default. Delete old thumbnails to have new transparent generated
  • Fixed so that preview images is not squared when THUMB_SQUARE is set to TRUE
  • Fixed a vulnerability in PayPal option, that could allow script in crafted URLs to run in client browser. The vulnerability was only present with PayPal option enabled
  • Fixed so that the information box stays closed when closed by user. It was a problem when changing directory with SHOW_INFO_BY_DEFAULT enabled
  • Fixed so that preview text box is not shown when preview is disabled

Single File PHP Gallery 4.7.0 (29-dec-2016)


  • Added Upload option to the admin functions
  • Changed keyboard navigation to only have effect when viewing images. Except Esc, which can also be used for jumping a directory up
  • Fixed the need to double click on elements on touch devices (iOS)
  • Fixed bug that made some servers not being able to use the admin option to move files
  • Minor code cleanup changes

Single File PHP Gallery 4.6.1 (08-jan-2016)


  • Added option to have thumbnails cropped to a square
  • Fiexd: Description for images not showing when IPTC information is disabled

Single File PHP Gallery 4.6.0 (09-dec-2015)


  • Added administrator options in browser to:
      1. Rename, move, and delete images and files.
      2. Rename, move, delete and create directories.
      3. Create, edit and remove descriptions for directories, images and files.
      4. Create, edit and remove PayPal selling information for images
  • Improved the URL's tamper resistance. Better check and stronger hashing
  • Changed the default DIR_THUMB_FILE back to '_image.jpg'
  • Changed the "click on hover" behaiviour to only auto-click on hover on iOS(iPhone and iPad). Previously this vas enabled on all touch enabled devices
  • Disabled keyboard navigation while in admin-mode
  • Other minor improvements

Single File PHP Gallery 4.5.7 (20-may-2015)


  • Added touch device detection to work better on iOS (Making javascript onMouseOver events also act as onClick events)
  • Fixed/Added extraction of missing IPTC Creation Date
  • Added check to hide empty fields in EXIF and IPTC information boxes. Only entries containing data will be shown
  • Added the NL_TO_BR that was removed in previous version. It is now called DESC_NL_TO_BR
  • Added meta viewport definition to better function with mobile devices
  • Added automatic generation of SECURITY_PHRASE. See SECURITY_PHRASE section for details
  • Fixed so that thumbnails for directories now also regenerate automatically if the source file time change. (You need to access the folder to trigger the regeneration)
  • Removed the ALLOW_DESC_HTML option. All descriptions are now treated as HTML
  • Minor fixes and improvements

Single File PHP Gallery 4.5.6 (15-dec-2014)


  • IMPORTANT INFORMATION
    Versions of Single File PHP Gallery below 4.5.6 could allow specially crafted code embedded in images (in EXIF or IPTC) or in description files, to reach end users browser for execution. All users of the gallery, having or allowing images and/or description files from untrusted sources, should upgrade to this version to keep end users safe from this risk
  • Improved security by adding HTML encoding of data sent to clients. See ALLOW_DESC_HTML option for information on how to enable HTML in descriptions
  • Removed the NL_TO_BR option (line breaks in description files will now always be shown)
  • Upgrading from a previous version of the script requires the contents of the DATA_ROOT to be deleted

Single File PHP Gallery 4.5.5 (13-dec-2014)


  • Added image area navigation. Clicking the left third of the image area when showing an image will go to previous image. The right third will go to the next image. Clicking the image in the middel third of the image will close the image. Related buttons in bottom menu light up when hovering these areas. The middle third of the image area can also be used to zoom and/or move the image around when watching a large image in actual size on a touch device
  • Added automatic recreation of data files, including thumbs and information, when images in GALLERY_ROOT are changed
  • Added option to have a banner/header shown in the gallery. Can be used as a standard banner on all pages or individual per directory. See TEXT_BANNER and DIR_BANNER_FILE for information
  • Moved the TEXT_CLOSE_IMG_VIEW button
  • Fixed handling of backslashes in input like EXIF, IPTC and description files
  • Fixed SHOW_IMAGE_DAYS not working correctly when not sorting by date in reverse order
  • Fixed $color_img_hover, $color_img_hover_text, $color_file_hover and $color_file_hover_text not being used

Single File PHP Gallery 4.5.0 (25-nov-2014)


  • Added option to password protect the gallery. See the PASSWORD option for details
  • Added option to enable delete functionality. Directories, images and files can be marked and deleted from within the gallery. See the ADMIN option for details
  • Added option to sort images by date/time from EXIF aka when the image was take. See the IMAGE_EXIF_TIME option for details
  • Added function to allow file-preview images to be used for gallery thumbnails
  • Improved the option to use images as thumbs for files by extension. Setting $file_ext_thumbs is no longer needed, so the $file_ext_thumbs setting have been removed. See the ICONS_DIR option for details
  • Changed constant name SORT_NATURAL to SORT_ALL_NATURAL because SORT_NATURAL is already defined by PHP
  • Changed constant name DIR_IMAGE_FILE to DIR_THUMB_FILE because it is a more saying name. Also changed the default setting from '_image.jpg' to '_dir.jpg'
  • Changed the DATE_FORMAT parameters
  • Changing the DATE_FORMAT no longer require rebuild of DATA_ROOT to apply
  • Upgrading from a previous version of the script requires the contents of the DATA_ROOT to be deleted

Single File PHP Gallery 4.4.0 (31-oct-2014)

  • Added 3D MPO image extraction, with red/cyan Anaglyph image and stereo image generation options
  • Added option to set or disable the round corners on boxes
  • Fixed "Empty regular expression" warning from showing on some servers

Single File PHP Gallery 4.3.0 (2-oct-2014)

  • Added option to enable slideshow
  • Added option to only show a set number of images
  • Added option to hide images older than a set number of days
  • Added option to delete images older than a set number of days
  • Added automatic clean-up function to have the gallery delete unused files in DATA_ROOT
  • Added option to enable simple PayPal integration with inventory counter for selling
  • Added option to show directory description inside the gallery using a new wider "thumb-box"
  • Added option to change the icons/watermark directory
  • Added option to set an image to be used as thumb on all directories not containing images
  • Added option to have the watermark scaled to a constant fraction of the full size image
  • Added disabling of image navigation (buttons and keyboard), while loading image
  • Improved disk performance by adding check of name and/or description files before trying to load them
  • Improved JavaScript function to show full size image faster
  • Improved full size image load to avoid fading in the previous image
  • Fixed choosing of thumb for directories. Was an issue when using SORT_ALL_NATURAL, which is default
  • Fixed handling of files and directories called "0" (zero)
  • Fixed so that information box does not close when using ESC to go one directory up

Single File PHP Gallery 4.2.0 (8-sep-2014)

  • Added keyboard navigation
  • Added IPTC information extraction, to be shown in the information box
  • Added option to use regular expressions for excluding directories, images and files
  • Added option to use low quality thumb and preview generation, to save CPU usage on slow servers
  • Added option to show information box by default
  • Added option to remove information button
  • Added round corners on thumbs and buttons
  • Improved JavaScript fade function to better work on slow clients
  • Improved change of full size image to avoid flicker on some systems
  • Changed representation of EXIF date, so that it now shows like defined in DATE_FORMAT. Previous it was shown in plain EXIF format
  • Fixed reverse natural sorting. When sorting natural and reverse, the reverse setting did not apply. It does now
  • Fixed handling of images, files and folders containing two or more tailing dots
  • Fixed check of read_exif_data function
  • Other smaller fixes, improvements and adjustments

Single File PHP Gallery 4.1.1 (20-aug-2011)

  • Fixed Internet Explorer sometimes only showing part of thumbnails

Single File PHP Gallery 4.1.0 (21-jul-2010)

  • EXIF extraction. If available in image file, the following EXIF information will be shown: Date, Camera, ISO, Shutter Speed, Aperture, Focal Length and Flash fired
  • Rotation option to automatically correct orientation of images, with information from EXIF
  • Watermark option to add watermark to all images in gallery
  • Thumbnail for non-images. Option for adding custom default thumbnails for file types. This can be used to have a thumbnail/icon on non-image files like PDF, AVI, ZIP or any other
  • Dynamic size presentation. Image and file size are shown as Bytes, KBytes, MBytes and so on

Single File PHP Gallery 4.0.0 (12-aug-2009)

  • Redesigned interface, with new client side JavaScript
  • Using DIV layer instead of pop-up windows for showing full images
  • Thumbnail view uses entire window aligning thumbs as they fit
  • Removed a lot of options that had to do with the old design

Single File PHP Gallery 3.6.0 (02-jul-2008)

  • Added option to sort directories, images and files by date/time (user request)
  • Added option to show "next page" and "previous page" links when thumbnail view are in pages (user request)
  • Remade function to create directories without using the recursive parameter (that was first added as of PHP 5.0.0) in order to have script work with PHP 4 (lots of user request)
  • Added a security feature that will make the gallery ignore all parameters not originating from the gallery itself
  • Added option to have a link to start a slideshow of all images in a directory. The slideshow works by automatically loading the next image in a given time (user request)
  • Added option to change the charset used to display the chars used in the gallery
  • Fixed page navigation links when in a sub-directory and TEXT_HOME set to "" (thanks Richard)
  • Fixed function of TEXT_CLICK_CLOSE link when IMAGE_IN_NEW_WINDOW is set to FALSE (thanks Richard)
  • Fixed directory creation of directories only containing files, in order to save file and directory information

Single File PHP Gallery 3.4.0 (30-apr-2008)

  • Added option to exclude directories from thumbnail view (user request)
  • Added option to show a download link below thumbnails and/or full images. (option is turned off by default) (user request)
  • Added option to show direct link to fullsize image page (can be used to link to an image from a blog, forum, e-mail etc.) (user request)
  • Added option to sort directories, images and files in reverse (user request)
  • Added option to show previous/next links above image (user request)
  • Added option to set where to show the page navigation links (above and/or below thumbnails)
  • Support for directories, images and files to contain non-alphanumeric chars
  • Fixed all TEXT_* constants so that they will now show non-alphanumeric chars

Single File PHP Gallery 3.0.0 (13-apr-2008)

  • Added option to split thumbnail view into pages using the ROWS_PER_PAGE constant (user request)
  • Added option to have thumbnails for files, that do not show up as images (user request)
  • Added support for .gif type images (user request)
  • Added option to show number of galleries, images and files below thumbnails for directories and/or as a title/hover (user request)
  • Added option to show date, file size and image size below thumbnails for images and/or as a title/hover (user request)
  • Added option to show date and file size below link or thumbnails for files and/or as a title/hover (user request)
  • Added option to set the jpeg quality from 0-100 using the JPEG_QUALITY (previous HIGH_QUALITY_THUMB could only be TRUE or FALSE) (user request)
  • Added option to show images first in full screen size, and when clicked in full resolution (user request)
  • Added table design in fullimage view (user request)
  • Added SHOW_DIR_DESC, SHOW_IMAGE_DESC and SHOW_FILE_DESC (previous only SHOW_IMAGE_TITLE)
  • Changed some java to make window resize and replace without the jump to (0,0) (user request)
  • Fixed "fflush" error (using another function) (user request)
  • Fixed, TEXT_PREVIOUS and TEXT_NEXT can now show spacial chars
  • Fixed a lot of php info and warning messages (on a normal configured server these messages would only be seen if reading the server log)

Single File PHP Gallery 2.0.0 (7-jan-2008)

  • Moved the gallery to a function to make it easier to include on existing pages (user request)
  • Added support of .png type images (user request)
  • Added option to show non-image files and images of non-supported types as download links in the gallery. With option to exclude specific files and file types (user request)
  • Added option to show "next" and "previous" links in full image view
  • Added option to use a specific image as thumbnail for directories (user request)
  • Added ENLARGE_SMALL_IMAGES to enable/disable enlargement of small images when creating thumbnails (user request)
  • Added "php" after <? at the very first of the script to have the script work on systems that require the php tag
  • Added option to have different colors for links under directories, windows and table
  • Fixed creation of thumbnail directories on Windows servers
  • Fixed displaying of CLICK_IMAGE so that it now works with special chars
  • Changed all CSS class names to contain "sfpg" so that it will not collide with existing CSS when included on existing pages
  • Changed many of the variables to constants
  • Removed the option to have sub galleries and images split into two different sections
  • Other minor changes and fixes