Webasyst Photo: an application for organizing and publishing photos

We have released the free Photos app for uploading, storing and publishing photos on the web. Powered by the Webasyst PHP Framework . License - LPGL.

The application can be installed on your server or hosting (PHP / MySQL) and publish photos in one of the following ways: 1) in the frontend of the application (in the public gallery) by albums, tags, a single photo stream, 2) receiving in the backend a link or HTML code to selected photos, followed by adding them to a blog, LiveJournal, forum or anywhere, 3) Do not publish at all and store all photos privately for yourself and your team in the backend (multi-user application).

The application is for those who want to organize a photo store on their website, and not on Vkontakte or Facebook.

Demo : frontend , backend (the rights to upload and edit photos are disabled in the demo)
Download : application (source code; ≈231 KB), framework
Briefly about the main functions of the application:

Photostream, albums, smart albums


Uploaded photos are automatically organized in a single photo stream, representing all photos in chronological order. Optionally, the photo can be divided into albums - one photo can be in several albums at once.

Albums are a hierarchical tree of unlimited nesting. The hierarchy is edited by drag and drop.



There are two types of albums:
- regular : typesetting, static; photos are added to such albums manually;
- “smart” : dynamic based on conditions; for example by tags or rating.

Tags, ratings (rating)


The basic functionality of the application allows you to put each photo rating (rating) from 0 to 5 and assign text tags. Based on this data, it is convenient to create dynamic “smart” albums.



In the future, we plan to expand the filtering capabilities with the help of sample plugins for other parameters: GPS image data, shutter speed, ISO, dominant color, etc.

Two levels of access to photos


The photo may be published or private . Published photos automatically appear in the frontend (a public photo gallery), and private photos are visible only to backend users. Moreover, for private photos, you can adjust access rights by indicating which user groups will see the photo and which will not.



Stacks


Any set of photos can be grouped into one group (stack), which will be displayed in photo lists and albums as a single photo. It is especially convenient for series of the same type of photographs (pay attention to sets of photographs with sparrows or paragliding in this example ).



Sketches and Originals


The application saves the original photos in the folder wa-data / protected / photos /, which is protected by .htaccess with the directive Deny from all. You can access the original photo only by knowing the private hash link: the photo is given through the script in a stream.

Thumbnails for general viewing are created from the original photo on the fly (on request) and are cached in wa-data / public / photos /, which is available for public access. You can get a sketch of the desired arbitrary size by specifying the size directly in the address. For example, http://demo-ru.webasyst.com/wa-data/public/photos/46/00/46/46. 970 .jpg will generate and return an image of size 970 pixels along the maximum edge, and http://demo-ru.webasyst.com/wa-data/public/photos/46/00/46/46. 500x100 .jpg - crop size of 500x100 pixels.

This approach to creating sketches allows you to create design themes for a public gallery as flexibly as possible and publish photos with at least square crop, at least 1000x50 pixel “stripes”. The design theme decides.

If there is concern about the excessive server load that thumbnail generation can create, then in the application settings you can disable this feature and specify a predefined set of thumbnail sizes explicitly, and they will be created when uploading photos immediately. Upon request, it will not be possible to create other sizes.



ImageMagick or GD is used as a graphics library.

Plugins


The “Photos” application supports the ability to expand functionality through plug-ins. Four plugins are currently available:
- Watermark: overlaying translucent text or images on all uploaded photos
- Effects: Sepia, black and white, and contrast image processing filters
- Comments: adds the ability to comment on photos in frontend and backend
- Import: import photos from the old version of the application ( WebAsyst Photos )
The application has many hooks, and this allows you to flexibly expand the functionality of the application, without fear that it will be lost during script updates.

Link with other Webasyst applications


The application is especially convenient in conjunction with other applications of the framework: “Photos” can be used as a storage for photos, and exported from it to other applications.

For example, in the “Blog” application: I selected individual photos from the album and immediately published a blog post (“Photos” itself prepares the HTML code for the post and immediately opens the page for creating a new blog post).

Or on the information page of the “Site” application: you can get a Smarty-code for export, for example, all photos with the tag “team” and copy this code to the page of the “Site” application. Then on the page photos from the storage will always be dynamically loaded according to the specified condition.



Well, there are a lot of other nice features: EXIF ​​data, photo descriptions, sharpness filter, drag-and-drop, selection of photos by click + Shift + click and more. It’s better to see for yourself in the demo: backend (sorry for readonly mode), frontend (default theme is used; design can be customized as you like; Smarty template engine is used).

Or download , install on your server and use. The application is free. We will be grateful for your comments, suggestions and constructive criticism.