summaryrefslogtreecommitdiff
path: root/src/jpeg-utils.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-04-03jpeg-utils: Override artist and owner nameTomas Bzatek1-0/+12
Useful to override previous camera owner name stored in EXIF.
2015-08-29jpeg-utils: Unify media libraries initializationTomas Bzatek1-0/+20
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-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-01jpeg-utils: Use the nicer unicode "f" for the aperture value stringTomas Bzatek1-1/+1
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-04Introduce new "fixed" thumbnail crop modeTomas Bzatek1-11/+29
This mode retains given aspect ratio and crops the area from inside of the source image.
2014-09-15theming: Allow themes to use different thumbnail image sizesTomas Bzatek1-27/+23
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-03-22Make error reporting nicer when referenced image is not availableTomas Bzatek1-0/+2
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-19/+19
This is a file format break within development branch.
2014-03-18Ignore zero raw values for Camera Temperature tag detectionTomas Bzatek1-6/+17
Some cameras have the Exif.CanonSi.0x000c tag present but set to zero (raw value). Since this would result in some -128 deg. C, ignore such values.
2014-03-18Add support for specifying custom focal length and apertureTomas Bzatek1-2/+28
Similar to using supplied timestamps this is useful for fully manual lenses that don't provide any information to the camera.
2014-03-15jpeg-utils: Strip all profiles from thumbnailsTomas Bzatek1-0/+2
This removes associated ICC profiles and such, though we should perform proper colorspace conversion to plain (s)RGB first.
2013-06-05jpeg-utils: Shift/fake also Exif.Image.DateTimeTomas Bzatek1-5/+2
Turned out the Exif.Image.DateTime key may contain original timestamp in some cases, e.g. when using extracted EXIF data from original image. Since we can't trust this key has ever been modified by a photo software, let's modify it together with other keys. It comes with a cost of changing correct timestamp but we can't really distinguish that.
2013-04-07Add ability to specify thumbnail square crop hintTomas Bzatek1-4/+21
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-03-17Dup exiv2 strings immediatelyTomas Bzatek1-8/+15
Weird things happened to me in the past while debugging, it's like the lifetime of returned const strings is unknown and we can't really rely on them, so let's duplicate them immediately. This will not however fully solve the issue but rather minimizes the risk. Need to investigate what's going on, don't really want to start using mutexes to ensure full thread safety. Moreover we have separate objects in each thread.
2013-03-17Support Iptc.Application2.Digitization{Date,Time} for time shifting and fakingTomas Bzatek1-17/+25
Turned out these two keys are commonly used as well.
2013-03-17Use reentrant versions of datetime functions for thread safetyTomas Bzatek1-27/+30
2013-03-16Strip XMP metadata by defaultTomas Bzatek1-1/+12
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-0/+13
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-16Support IPTC timestamps when shifting or fakingTomas Bzatek1-19/+99
There are more date-related IPTC tags in the specs but so far I haven't seen anything else than Iptc.Application2.{Date,Time}Created
2013-03-10Add support for specifying custom dateTomas Bzatek1-33/+79
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-31/+139
Simple datetime shift, including EXIF data modification.
2012-12-27jpeg-utils: Tidy up get_exif_data_fixed() a bitTomas Bzatek1-26/+17
And change g_str_has_prefix() for key name comparison to g_str_equal() to prevent potential prefix clashes.
2012-12-27jpeg-utils: Use Exiv2::Exifdatum.count() for key presence testTomas Bzatek1-6/+2
2012-12-27Add support for EXIF Canon Camera temperatureTomas Bzatek1-0/+40
For the moment we're using Exif.CanonSi.0x000c key from Exiv2 namespace since it's an unknown tag to it. This may need little tweaking in the future when proper naming becomes upstream.
2012-04-15Add HAS_EXIF defineTomas Bzatek1-0/+35
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-175/+145
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-05jpeg-utils: Get rid of static variablesTomas Bzatek1-2/+5
2011-06-04Autorotate images according to EXIF Orientation infoTomas Bzatek1-3/+77
This comes with a cost of decoding full image when only getting image size.
2010-12-12jpeg-utils: Get rid of error handling macrosTomas Bzatek1-91/+79
2010-12-12jpeg-utils: Function data cleanupTomas Bzatek1-6/+5
2010-10-30Don't resize an image if it fits in desired sizeTomas Bzatek1-17/+22
2010-10-10Do crop and shave in one stepTomas Bzatek1-5/+1
Silly me, this can be easily done at once.
2010-10-09Add support for squared thumbnailsTomas Bzatek1-5/+27
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-06Fix day of the week in EXIF date stringTomas Bzatek1-0/+1
mktime() modifies tm_wday and tm_yday to correct values.
2009-05-10Remove #ifdef __DEBUG_ALL__Tomas Bzatek1-22/+0
2009-05-10Consolidate data typesTomas Bzatek1-73/+51
2009-04-11Print statistics in verbose modeTomas Bzatek1-4/+5
2009-03-28Multithreading supportTomas Bzatek1-4/+0
Also made progress output a little bit nicer default = 1 thread at once, for safety reasons I've encountered critical issues with ImageMagick compiled with OpenMP support. Hope that package maintainers are clever. ShittyMagickWandGenesis(), ShittyMagickWandTerminus() :-)
2009-02-27Fix exiv2 new api detectionTomas Bzatek1-0/+2
2009-02-26AutotoolizeTomas Bzatek1-0/+429