summaryrefslogtreecommitdiff
path: root/src/generators.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-25theming: Make custom image size handling fully flexibleTomas Bzatek1-53/+44
This commit brings full flexibility of custom image size definition and usage. When a custom image size is defined, it automatically maps to the album <item> tag arguments. Alternatively, this automatic name matching can be overriden by <size tagname="..."> theme setup tags. This allows us to supply image of different sizes that can be also used in templates. Legacy behaviour of "fullsize" and "preview" image size fallback is retained (though not recommended in new theming setups).
2015-01-11generators: Remove unnecessary picture page global blockTomas Bzatek1-25/+14
Turned out there was no need for having most of the picture page closed in a block.
2015-01-11generators: Allow undefined album image and thumbnail sizesTomas Bzatek1-76/+77
There may be certain cases where images or thumbnails on album pages are not needed and textual representation is just fine. Metadata pulled from the source image files are still processed and exposed.
2015-01-04Introduce new "fixed" thumbnail crop modeTomas Bzatek1-4/+15
This mode retains given aspect ratio and crops the area from inside of the source image.
2015-01-04generators: Newline at the end of generated .htaccess fileTomas Bzatek1-1/+2
2015-01-04generators: Use single function for all templatesTomas Bzatek1-526/+537
This commit makes use of a common function for all template parsing and page writing. The behaviour is controlled by the "item" argument passed in. This allows us to have a single code that generates code for list of items as well as for a single item. In the future, this can be used for e.g. combining thumbnails and large images on the same page. Other than that this commit also brings several other changes: - further clarification of theming setup XML file - <protected_thumbnail> tag has been moved out of the <album> structure into the <index> structure where it functionally belongs. Only whole albums can be protected and the substitute thumbnail is displayed on index pages. - position marker format has been broken out to a constant - added few more FIXMEs to mark places that will change soon - some template variables have been renamed
2014-09-18generators: Separate common code outTomas Bzatek1-142/+136
2014-09-17theming: Make navigation bar strongly themedTomas Bzatek1-81/+169
Navigation bar can be complex and comprises of several different elements. Until now the navigation bar was almost hardcoded. We needed to separate different types of navigation bar elements: * NAV_BAR_FIRST - the first element, usually denoting gallery root. This element takes priority and is used when there are no other elements in the path. * NAV_BAR_ELEM - normal element used in the path between first and last elements. * NAV_BAR_LAST - ending element, guaranteed there's at least the NAV_BAR_FIRST element before. * NAV_BAR_CURRENT - non-clickable informational element displaying the current page title. Optional, in contrast to the former three defines. * NAV_BAR_CURRENT_ROOT - a special case of the latter one, displayed at the very root page. Also optional, in that case the navigation bar would become empty.
2014-09-15theming: Allow themes to use different thumbnail image sizesTomas Bzatek1-60/+44
This change makes thumbnail image sizes more flexible by explicitly stating the particular image size is a thumbnail. And each thumbnail image size can have different squared settings. On the theme side it's now mandatory to specify which thumbnail size to use (if applicable). This allows us to have different thumbnail styles for index and album pages. This commit also removes the <squared_thumbnails> tag from setup.xml file but retains fallback for ver. 1 setup.xml files.
2014-09-15theming: Define meaning of the <no_resize> tagTomas Bzatek1-1/+1
Although probably not very common scenario, let's be consistent across all defined image sizes and clearly state that an explicitly supplied image file for an optional image size should carry the tag in order not to get resized.
2014-09-13Introduce properties tableTomas Bzatek1-38/+33
This is a new internal properties storage for attributes that can be defined both in the item and album scope, with the item scope taking priority. The big advantage is a better distinguishment from an undefined, default value. It also makes easier to retrieve attributes with properly defined scope priorities.
2014-03-22Make error reporting nicer when referenced image is not availableTomas Bzatek1-10/+28
There were lots of errors reported for the same issue recently, let's silence some and only report image copy/resize errors.
2014-03-18Use "override" terminology instead of "fake"Tomas Bzatek1-9/+9
This is a file format break within development branch.
2014-03-18Allow absolute pathnames for external EXIF dataTomas Bzatek1-2/+2
2014-03-18Add support for specifying custom focal length and apertureTomas Bzatek1-0/+8
Similar to using supplied timestamps this is useful for fully manual lenses that don't provide any information to the camera.
2013-04-07Add ability to specify thumbnail square crop hintTomas Bzatek1-4/+11
In simple crop square mode it's sometimes viable to specify position of the square. This is vastly useful for portrait pictures so that you don't crop the head off the body.
2013-04-07Use rel="home" for links pointing to gallery rootTomas Bzatek1-2/+2
Hopefully some browsers would understand that. http://microformats.org/wiki/existing-rel-values
2013-04-07Strip unused template tags by defaultTomas Bzatek1-0/+3
If there's a tag defined but not used on replace table processing, this option determines whether it should be written in the generated file or ignored completely. Turned on by default, this will save a few bytes. Use commandline option '--debug-dont-strip-unused-tags' to turn it off, e.g. when debugging template files.
2013-03-16Strip XMP metadata by defaultTomas Bzatek1-1/+1
Some RAW editors like Adobe products like to include XMP data. Let's strip them all off (unless disabled).
2013-03-16Add support for writing external EXIF metadata back to imagesTomas Bzatek1-2/+10
Turned off by default, this will copy all data from supplied external EXIF metadata file back to all generated image files. All user overrides are still applied on top of it. Another reason for turning this off is file size concern, target image files would carry a lot more information that may not be always needed and would increase total amount of data transferred.
2013-03-10Add support for specifying custom dateTomas Bzatek1-0/+3
This essentially means faking the datetime, e.g. when you want to mask original picture date. This commit also changes little bit of datetime conversion, hopefully fixing DST issues. Needs more testing.
2013-03-10Add support for datetime/timezone shiftTomas Bzatek1-2/+24
Simple datetime shift, including EXIF data modification.
2013-02-10Show note for password protected albums on index pagesTomas Bzatek1-0/+1
Also adds IS_PROTECTED define in local item scope.
2013-02-10generators: Process image blocks through local block parsersTomas Bzatek1-21/+31
This change allows using local defines related to each item in the album or index page.
2013-02-10Support theme-defined thumbnail for protected albumsTomas Bzatek1-11/+26
2012-12-31Add support for password protected albumsTomas Bzatek1-0/+76
This adds support for simple password protected areas (albums and all subalbums) through webserver HTTP authentication. CGG simply generates .htaccess and password files and it's up to the user to set up the rest on server side. No UI changes at this point. Limited to one user per album for the moment.
2012-12-27Support external EXIF metadataTomas Bzatek1-2/+10
This brings an ability to specify external file to read EXIF/IPTC data from. The motivation was to work around RAW editors randomly stripping some EXIF blocks.
2012-12-24Add has_exif_key() block functionTomas Bzatek1-0/+13
Simple check whether the EXIF/IPTC key is available for the current image. Precisely one argument is required, similar to the get_exif_value() custom function, an Exiv2 metadata attribute string is expected. This allows templates to change behaviour when certain metadata key is not present (e.g. don't print the particular table line at all).
2012-04-15Add HAS_EXIF defineTomas Bzatek1-0/+5
This brings a new HAS_EXIF define which is present when EXIF information are available. Templates have been modified to inform user when not available. The test for EXIF metadata presence is fairly basic, we only look for aperture, focal length and exposure time attributes. This might be a subject to change in the future.
2012-04-15Change EXIF metadata handling into a registered functionTomas Bzatek1-28/+43
This allows much greater flexibility from templates regarding EXIF metadata handling, no more hardcoded symbols. It's possible to display essentially any attribute known to Exiv2. Please see http://exiv2.org/metadata.html This brings two new functions that can be called from templates: * get_exif_value (exiv2_attribute) * get_exif_value_fixed (exiv2_attribute) Both functions take a string argument of metadata attribute name from Exiv2 namespace. The difference is that get_exif_value_fixed() does some extra formatting for several basic attributes (e.g. datetime format).
2011-06-05generators: Actually use preview size when nofullsize is specifiedTomas Bzatek1-23/+30
2011-06-04Autorotate images according to EXIF Orientation infoTomas Bzatek1-5/+5
This comes with a cost of decoding full image when only getting image size.
2011-06-04Port fullsize image link to the new defines systemTomas Bzatek1-15/+3
2011-06-04Port Go Up link to the new defines systemTomas Bzatek1-11/+2
2011-06-04Port EXIF table visibility switch to the new defines systemTomas Bzatek1-9/+0
2011-06-04Port border style to the new defines systemTomas Bzatek1-5/+2
This change allows greater flexibility for separate themes.
2011-06-04replace-table: Link to defines table instead of copying on creationTomas Bzatek1-5/+8
This allows actual defines to be used without explicit update. Also brings the benefit of placing empty string when define is not defined.
2011-06-04Introduce conditional systemTomas Bzatek1-3/+11
This is very basic scripting support - simple value retrieval and block conditionals. Defines could be either static from theme setup or programatically added during page generation.
2011-05-29Introduce new theming systemTomas Bzatek1-264/+300
This extends current templating system to another dimension, bringing the possibility to have multiple themes generated at once. The purpose is to be able to switch between multiple designs, from PC to mobile, classic vs. flat view, slideshow, etc. For the moment, only the classic theme is available. Rules: * for switching between themes, place a link inside your template manually - it's not a cgg concern, only your theming infrastructure * don't forget to define different file names for index and album pages across different themes * it's recommended to keep default theme named as "index.*" to avoid showing directory listing on webserver Notes: * some TODOs will be fixed when we have new theme using these advanced features (e.g. pictures in album pages) * TODO: introduce tag/block conditional system, allow custom user defines for each theme/page * TODO: deprecate <show_go_up>, <show_exif_table> and <border style> in favor of conditionals (these tags belong to theming)
2011-03-26Don't generate thumbnails for hidden itemsTomas Bzatek1-13/+15
2011-01-23Get thumbnail orientation when really neededTomas Bzatek1-19/+22
No need to store generated data during thread work anymore.
2011-01-23Indentation fixesTomas Bzatek1-14/+15
2011-01-23Use g_build_{filename|path} when possibleTomas Bzatek1-15/+15
This has a nice side effect of not having double slashes in paths anymore.
2011-01-23Consolidate paths in a separate structTomas Bzatek1-20/+18
This will allow us to pass detailed path info to worker methods. Each path info instance is bound to a currently processed album and directory. Possibly move to struct TItems in the future.
2010-12-12jpeg-utils: Function data cleanupTomas Bzatek1-1/+2
2010-10-30Write image sizes for thumbnails in HTML filesTomas Bzatek1-1/+10
2010-10-09Add support for squared thumbnailsTomas Bzatek1-3/+14
Disabled by default, only very simple center crop implemented. The SQUARED_SIMPLE_SHAVE_AMOUNT constant may be slightly adjusted according to future experience. It's a really dumb algorithm which may not be suitable for every picture. Looking for a fast and smart algorithm to determine image weight center and radius, i.e. focus on object of interest. The OpenCV's face recognition features are worth to test and consider, though I fear the speed issues.
2010-10-08Add basic Atom feed writerTomas Bzatek1-0/+18
2010-10-07Add some more application constantsTomas Bzatek1-1/+1
2010-07-22Add option to generate full gallery, overriding the nofullsize switchTomas Bzatek1-2/+3
This option takes the highest priority