summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2025-06-08build: Fix libxml2 includesTomas Bzatek1-1/+2
2019-09-20generators: Force even base image dimensions for fractional HiDPI sizesTomas Bzatek3-12/+34
In case a dimension of the base image is not even and fractional HiDPI size is to be generated, the resulting image size computes to a non-integer values. Rounding in browsers may vary so let's stick with safe values and force even base image dimensions. This may result in slight crop applied before resize, generally imperceptible. Tested on Chromium 69 and Firefox 52.
2019-05-13jpeg-utils: Don't override Exif.CanonSi.ApertureValueTomas Bzatek1-2/+0
Newer exiv2 versions don't like it. Sadly this will fail whole metadata write, stating plain "Failed to write image" error.
2019-05-13Plug some memory leaksTomas Bzatek3-2/+8
2019-05-13jpeg-utils: Port to gexiv2Tomas Bzatek3-446/+334
The gexiv2 library is just a GObject wrapper around exiv2 library. It's a healthy project that continually keeps up with exiv2 API changes. Adopted by e.g. GIMP there's certain guarantee of future maintenance. This allows us to get rid of C++ code, making it more readable and predictable.
2019-05-11build: Fix minor compiler warningsTomas Bzatek7-14/+15
2019-05-11build: Split libraries detectionTomas Bzatek1-8/+16
Includes some automake files cleanup and enables extra compiler warnings.
2018-12-15theming: Add option to disable HiDPI for any particular image sizeTomas Bzatek1-1/+6
Useful for 4k size where additional HiDPI sizes (i.e. 6k and 8k) are overkill to generate and aren't very common on the market yet.
2018-12-14jpeg-utils: ImageMagick 7 adaptationsTomas Bzatek1-1/+11
MagickWand comes with a couple of incompatible API changes in version 7.
2018-12-14jpeg-utils: Fix ImageMagick includesTomas Bzatek1-1/+1
Thanks to Sebastian Pipping for nagging me loudly about this!
2017-05-07jpeg-utils: Allow custom datetime formatTomas Bzatek5-2/+8
The default locale datetime format string may not suit everyone, this adds possibility to specify custom format. The format string should be syntactically conforming to strftime(3).
2016-10-18generators: Take the optional shave amount in account for dimension calculationTomas Bzatek1-0/+7
2016-10-04items: Add option to shave image bordersTomas Bzatek5-1/+14
A workaround for badly exported images that contain some garbage at the borders. The amount specifies how many pixels should be shaved from all borders (i.e. amount of 2 results in 4x4 pixels loss). Applicable for particular items or whole album (<general> section) with the following syntax: <shave amount="1" />
2016-10-02Add support for HiDPI imagesTomas Bzatek5-71/+236
This works by creating corresponding hidpi image sizes on startup and letting the machinery generate high resolution images from the source images (no way to use supplied images). However since browsers expect exact image dimension multiples for the particular scale factor, a reference image size (scale factor 1.0x) must be read first, then cropped to match reference aspect ratio and resized to exact dimensions. That way pixel-perfect results can be achieved for the chosen scale factor. TODO: the CSS background-image: image-set() tags are not supported on Firefox. TODO: try the 1.5x scale factor
2016-10-02generators: Don't read EXIF data for all image sizesTomas Bzatek1-1/+1
EXIF data were read in cases where weren't even used.
2016-10-02jpeg-utils: Add support for custom resize optionsTomas Bzatek7-12/+169
This change brings the possibility to tweak resize options using standard ImageMagick `convert` command syntax. Separate options are offered for thumbnails.
2016-09-23generators: Make image quality threshold inclusiveTomas Bzatek1-1/+1
(95% + 5% threshold == 100% source image quality acceptance)
2016-09-23generators: Expose all image sizesTomas Bzatek1-12/+55
A new block LIST_PICTURE_ALL_SIZES has been introduced to expose all available image sizes when iterating through the album items. Image size availability can be tested by the HAVE_IMG_SIZE_xxx define where "xxx" is an upper-case image size name as defined in the theme XML file. Similarly the image standard tags IMG_SIZE_W__xxx, IMG_SIZE_H__xxx and IMG_SRC__xxx have been introduced as well.
2016-09-19block-parser: Clear processed data for further useTomas Bzatek3-3/+37
This change will allow certain blocks to be present multiple times and processed independently within a single page.
2016-09-18Introduce resizing thresholdsTomas Bzatek7-132/+248
This commit brings deeper changes to the image sizes concept. The goal was to allow more flexible input in resizing vs. supplied files mixed mode. Instead of hard <noresize> flags the decision whether to resize or copy an image is now based on threshold. While not 100% universal, it brings more control regarding image size bounds. Also brings a level of tolerance for specific errors (off-by-one exports). Image sizes' rules are a bit simpler, hopefully easier to understand. A lot can be achieved by combination of thresholds.
2016-09-17Drop explicit references to "original" and "preview" image sizesTomas Bzatek3-46/+42
All image sizes are now equal, no special treatment (except of thumbnails).
2016-09-17Drop legacy nofullsize and album width/height/quality tagsTomas Bzatek6-135/+42
This drops the legacy functionality that doesn't really fit into the new flexible design concept and makes code unnecessarily complicated. Most of these overrides affected only the "preview" image size anyway. This also makes the <item src> attribute mandatory as it's being the only source of metadata (unless overriden or supplied externally). This unfortunately breaks the so-far 100% album XML files compatibility.
2016-09-11generators: Optionally warn when an image is being resizedTomas Bzatek3-3/+12
This adds commandline argument --debug-warn-resize that is useful for debugging image resizing, particularly for detecting unintended supplied image resizes.
2016-09-11atom-writer: Use _DEFAULT_SOURCE instead of deprecated _BSD_SOURCETomas Bzatek1-1/+1
Needed for struct tm.tm_gmtoff
2016-04-03cgg-dirgen: Support the 'hires' image sizeTomas Bzatek1-0/+13
Used by the new fluid theme.
2016-04-03jpeg-utils: Override artist and owner nameTomas Bzatek7-0/+31
Useful to override previous camera owner name stored in EXIF.
2016-04-03gallery-utils: Copy extra files recursivelyTomas Bzatek3-2/+44
This brings support for copying whole directories when specified in album extra files or template supplemental files.
2015-08-29jpeg-utils: Unify media libraries initializationTomas Bzatek3-6/+30
Both MagickWand and exiv2 needs some initialization and cleanup, move it to jpeg-utils for clean includes in cgg.c. Also add explicit exiv2 XMP initialization as stated on http://dev.exiv2.org/projects/exiv2/wiki/Thread_safety: "The XMP SDK initialization function is not mutex protected, thus Exiv2::XmpParser::initialize is not thread-safe. Therefore, multi-threaded applications need to ensure that this XMP function is serialized, e.g., by calling them from an initialization section which is run before any threads are started." See also https://bugs.kde.org/show_bug.cgi?id=166424
2015-08-29setup: Fix setup files version checkTomas Bzatek1-3/+3
Logical issue, found by a gcc-5.2.0 warning.
2015-08-29jpeg-utils: Filter out certain tags from external EXIF fileTomas Bzatek1-1/+80
Turned out that we shouldn't blindly copy all metadata from the supplied external EXIF file since they belong to a different image. This includes image size, JPEG compression parameters, rotation etc. This commit adds tag filtering so that not all tags are copied, retaining the important ones from the gallery image. The list of retained tags is by no means complete and is subject to future tweaks. For the moment this feature is recommended to be turned off (and is by default).
2015-02-01theming: Fix thumbnail sizes validationTomas Bzatek1-2/+5
2015-02-01generators: Expose ITEM_INDEX value for non-picture itemsTomas Bzatek1-1/+4
The returned number corresponds with the next picture item ID, for templates to present related information (i.e. section beginning) for the particular picture.
2015-02-01jpeg-utils: Use the nicer unicode "f" for the aperture value stringTomas Bzatek1-1/+1
2015-02-01theming: Introduce image size fallback modeTomas Bzatek3-38/+87
This changes image size handling a little bit. An optional <fallback size="xxx" /> tag tells the generator to use different image size when an image for the current image size has not been supplied from the album XML file. This is effectively used for the legacy <nofullsize> tag fallback. More generally this is useful for templates showing additional image sizes. Also saves space as images not having the custom size supplied are not generated from the source image.
2015-02-01jpeg-utils: Add some assertsTomas Bzatek1-0/+8
Users are not really supposed to hit any of them, it would indicate a programmer mistake otherwise.
2015-01-30theming: Fix the have_image_size() nofullsize testTomas Bzatek1-4/+0
The "original" image size presence should not really be reported when the "preview" image size substitutes it due to its absence (not defined in the album XML file).
2015-01-30theming: Implement have_album_image_size() block functionTomas Bzatek1-0/+37
Similar to the have_image_size() block function this is its variation operating over the album. The block condition is true if there's at least one item in the album of the specified image size. Respects the legacy "nofullsize" tags. Takes one mandatory argument of image size name.
2015-01-26block-parser: Don't call the destroy func on NULL user_data pointerTomas Bzatek1-1/+1
2015-01-25theming: Implement have_image_size() block functionTomas Bzatek1-0/+45
This can be used to query image size availability for the current item. While images are normally generated for theme-defined image sizes and thus guaranteed to be available, this function queries if the image of defined size has really been supplied in album XML files. Takes in account the legacy "nofullsize" tags. Takes one mandatory argument of image size name.
2015-01-25block-parser: Enhance block_parser_register_function() with a destroy notify ↵Tomas Bzatek3-16/+25
callback
2015-01-25generators: Rename HAS_ conditionals to HAVE_Tomas Bzatek1-4/+4
... just a matter of personal taste. Note: this breaks the template API only in current unreleased versions.
2015-01-25theming: Make custom image size handling fully flexibleTomas Bzatek6-93/+120
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-11theming: Make lookup_image_size_for_name() NULL-awareTomas Bzatek1-0/+3
2015-01-11theming: Remove invalid <picture> theme validation checkTomas Bzatek1-5/+1
As per rules defined in the sample default.xml setup file the whole <picture> theme definiton block is not mandatory anymore. The rest of the code plays nicely already.
2015-01-04Introduce new "fixed" thumbnail crop modeTomas Bzatek5-20/+65
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 Bzatek6-566/+560
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