Commit Graph

21 Commits

Author SHA1 Message Date
Michael Natterer 93d2f49c16 Bug 784961 - Undeclared identifier 'TIME_UTC' - GIMP fails to build...
...on macOS (with macports)

Changed gimp_metadata_get_guid() to use a GRand that automatically
seeds itself from /dev/urandom (if available) or the current time.
2017-07-16 14:01:18 +02:00
Michael Natterer 747b3768ef libgimpbase: remove gimp_metadata_register_xmp_namespace[s]()
and do the same in gimp_metadata_class_init(). Also fix all compiler
warnings and other stuff.
2017-07-07 19:11:12 +02:00
Ben Touchette dc9856cfe1 Bug 769820 - Cannot enter Iptc information when no metadata is available...
...and fails to write it to file when it is

Completely redo metadata editor and viewer code, adds support for
Xmp.xmpMM.History and more.
2017-07-07 18:11:39 +02:00
Simon Budig 0d073b943c libgimpbase: make the private data size > 0 to avoid critical warnings 2017-01-30 17:05:23 +01:00
Simon Budig 884edf56ca libgimpbase: make GimpMetadata its own type derived from GExiv2Metadata 2017-01-30 16:43:59 +01:00
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Michael Natterer e5a669bdfc libgimpbase: fix gimp_metadata_set_from_xmp() to really expect XMP
Don't skip the first 10 bytes. That code was there to skip the magic
"GIMP_XMP_1" of the old "gimp-metadata" parasite. Instead, properly
check for that magic in xcf_load_image() and pass only the actual XMP
to gimp_metadata_set_from_xmp(). Also remove the +10 hack in file-exr.
2016-04-22 22:49:06 +02:00
Massimo Valentini a3f4c50b3e Bug 765411: CRITICAL warnings loading an xcf with...
"exif-data" parasite

To migrate old "exif-data" parasites to GimpMetadata
an exif-only jpeg file is generated in memory, but its
APP1 marker length was 2 bytes short resulting in a
CRITICAL warning:

** (gimp-2.9:9): CRITICAL **: Directory Photo: IFD exceeds data buffer, cannot read next pointer.

Properly terminating the jpeg with an EOI marker also
gets rid of the WARNING:

** (gimp-2.9:9): WARNING **: JPEG format error, rc = 5
2016-04-22 17:30:44 +02:00
Michael Natterer 6c20609f96 Bug 492048 - Detect color space in Exif 2.21/DCF 2.0 option files
Change the logic in gimp_metadata_get_colorspace() to be like in the
respective KExiv2 function, which looks pretty well done. No guarantee
of correctness, this just looks more logical than before :)
2015-10-06 21:32:12 +02:00
Michael Natterer 15b7b17b12 Bug 492048 - Detect color space in Exif 2.21/DCF 2.0 option files
Some refactoring: add gimp_metadata_get,set_colorspace() and a new
enum GimpMetadataColorspace which so far can be one of { UNSPECIFIED,
UNCALIBRATED, SRGB, ADOBERGB }. The setter is untested and I don't
know if it's doing the right thing, please review. Use the getter in
gimp_image_metadata_load_finish(), so complex metadata logic and
profile creation/setting are separated.
2015-09-30 20:51:40 +02:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
2015-05-31 21:18:09 +02:00
Michael Natterer 24da0007a4 libgimp*: some API doc fixes 2015-05-31 14:40:20 +02:00
Michael Natterer 33a8d68117 Bug 711241 - Broken or unknown metadata tag should not cancel...
...the whole metadata loading

Don't drop non-utf8 values from gexiv2 when serializing to XML,
instead, base64 encode them. This should be robust against whatever
garbage data is in tags.
2013-11-11 00:11:43 +01:00
Michael Natterer ce57aef6ee libgimpbase: fix gimp_metadata_set_resolution() to only set rationals
Rationals have integers as nominator and denominator, so we can't set
something like "300.5/1". Instead, multiply the nominator and
denominator of non-integer ppi values until the error is smaller than
0.01, or the denomiator reaches 100 ("300.5/1" becomes "601/2").
2013-11-01 17:36:26 +01:00
Michael Natterer e03fd943bf libgimpbase: use gexiv2_metadata_get_exif_tag_rational() to get the resolution
and remove our own rational parser, we can get it back from git if we
need it again.
2013-11-01 17:01:44 +01:00
Michael Natterer 798c62a544 Bug 711241 - Broken or unknown metadata tag should not cancel...
...the whole metadata loading

Don't serialize a value that does not UTF-8-validate to XML. This is
not a real fix, but no matter what we do here in the future, UTF-8
validation should always be part of the serialization, in order to
avoid passing broken data into the core.
2013-11-01 14:15:15 +01:00
Michael Schumacher 8db3b4312d Global EXIF -> Exif string change (official spelling) 2013-10-29 22:48:46 +01:00
Michael Natterer 573a8513a5 libgimpbase: add API docs to libgimpbase/gimpmetadata.c 2013-10-27 21:13:51 +01:00
Michael Natterer 0b8e59c84e libgimpbase: fix typos in gimpmetadata.c 2013-10-27 16:32:26 +01:00
Hartmut Kuhse 21bed1e2fb Completely rewrite metadata handling using gexiv2
Based on original patches from Hartmut Kuhse and modified
by Michael Natterer. Changes include:

- remove libexif dependency and add a hard dependency on gexiv2
- typedef GExiv2Metadata to GimpMetadata to avoid having to
  include gexiv2 globally
- add basic GimpMetadata handling functions to libgimpbase
- add image and image file specific metadata functions to libgimp,
  including the exif orientation image rotate dialog
- port plug-ins to use the new APIs
- port file-tiff-save's UI to GtkBuilder
- add new plug-in "metadata" to view the image's metadata
- keep metadata around as GimpImage member in the core
- update the image's metadata on image size, resolution and precision
  changes
- obsolete the old metadata parasites
- migrate the old parasites to new GimpMetadata object on XCF load
2013-10-27 01:02:17 +02:00