News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

support for current GIMP format?

Started by carlseibert, August 19, 2018, 08:05:38 PM

Previous topic - Next topic

carlseibert

Hi,

Apparently, for the new 2.10.x version of the GIMP, the .XCF file format has changed. According to the docs, Exiftool can read .XCFs. But can it read the newest ones?

The GIMP now supports IPTC metadata. (Or will, once some bugs have been squashed) I have volunteered to help out. It appears to me that GIMP is currently writing malformed XMP that is not readable by other programs. But it may be that I'm not seeing their metadata because Exiftool might not be. Thus, the question.

It also appears that GIMP isn't writing to the IIM data block at all. Which is another matter altogether.

The bug track entry for the XMP issue is here:   https://gitlab.gnome.org/GNOME/gimp/issues/2043

If anybody has any ideas, I'm sure they'll be appreciated. The developers seem like good folks.

And, of course, if we can help them endow a popular photo editing application with standards compliant metadata functionality, that will be a very, very good thing. :-) 

Phil Harvey

I would appreciate a sample once GIMP has stabilized -- then I can add support for the new format.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

carlseibert

"once GIMP has stabilized"

Could be a bit of the chicken and egg crossing the road there metadata-wise, since I'm pretty sure what's being written now is malformed XMP and no IIM at all. But without ExifTool, it will be hard to tell.

That said, as ExifTool isn't concerned with the image part of the file, it's entirely possible that your current version IS able to read these files already.

Obviously, they need to get their export function working right, too. And when that happens, we can look at metadata on JPEGs and TIFFs and the like. At the moment, taking a look in a hex editor reveals no metadata at all, malformed or otherwise, on exported files.

Looking at the docs, it doesn't look like the new stuff affects the first little bit of the header. (To me. The One Who Can't Code.) https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt

Hmmm. This is interesting. I do see that 2.10.x is to include full support for metadata in WEBPs. That's something to celebrate when it happens!

To my knowledge, that will make the GIMP the first practical photo app to support metadata on WEBPs. (I've been able to add metadata to a WEBP by converting a file from JPEG to WEBP with cwebp on the command line and then reading with ExifTool. But, so far that's the best I've come up with. And the clock is ticking, with WEBP browser support approaching 70%.)

I don't know whether it will do you any good or not, but here is a sample file from GIMP 2.10.4, as of a few minutes ago. As you can see, ExifTool is reading some tags from it.

-Carl

Alan Clifford

I switched off "save xmp" data when exporting from the Gimp, probably years ago.  I can't remember what was being messed up.

Phil Harvey

#4
Hi Carl,

Ah.  They have increased the size of the header, which completely breaks forward compatibility because the header size isn't stored anywhere in the structure.  This is a real rookie mistake.  You need to know that XCF version 4 or later has a larger header to be able to parse the rest of the file.

I'll add support for this in ExifTool 11.11.

Thanks for pointing this out.

Here is what the -v3 output will look like for the file you posted:

# exiftool -v3 sample.xcf
  ExifToolVersion = 11.11
  FileName = sample.xcf
  Directory = ../pics
  FileSize = 1688711
  FileModifyDate = 1534853488
  FileAccessDate = 1534856556
  FileInodeChangeDate = 1534853488
  FilePermissions = 33188
  FileType = XCF
  FileTypeExtension = XCF
  MIMEType = image/x-xcf
  Header (SubDirectory) -->
  + [BinaryData directory, 26 bytes]
  | XCFVersion = v011
  | - Tag 0x0009 (5 bytes, string[5]):
  |     0009: 76 30 31 31 00                                  [v011.]
  | ImageWidth = 2100
  | - Tag 0x000e (4 bytes, int32u[1]):
  |     000e: 00 00 08 34                                     [...4]
  | ImageHeight = 1050
  | - Tag 0x0012 (4 bytes, int32u[1]):
  |     0012: 00 00 04 1a                                     [....]
  | ColorMode = 0
  | - Tag 0x0016 (4 bytes, int32u[1]):
  |     0016: 00 00 00 00                                     [....]
XCF property 17 (1 bytes):
  Compression = 2
  - Tag 0x0011 (1 bytes, int8u[1]):
      0026: 02                                              [.]
XCF property 19 (8 bytes):
  Resolution (SubDirectory) -->
  - Tag 0x0013 (8 bytes):
      002f: 42 90 00 00 42 90 00 00                         [B...B...]
  + [BinaryData directory, 8 bytes]
  | XResolution = 72
  | - Tag 0x0000 (4 bytes, float[1]):
  |     002f: 42 90 00 00                                     [B...]
  | YResolution = 72
  | - Tag 0x0001 (4 bytes, float[1]):
  |     0033: 42 90 00 00                                     [B...]
XCF property 20 (4 bytes):
  Tattoo = 2
  - Tag 0x0014 (4 bytes, int32u[1]):
      003f: 00 00 00 02                                     [....]
XCF property 22 (4 bytes):
  Units = 1
  - Tag 0x0016 (4 bytes, int32u[1]):
      004b: 00 00 00 01                                     [....]
XCF property 21 (2313 bytes):
  Parasites (SubDirectory) -->
  - Tag 0x0015 (2313 bytes):
      0057: 00 00 00 14 67 69 6d 70 2d 69 6d 61 67 65 2d 6d [....gimp-image-m]
      0067: 65 74 61 64 61 74 61 00 00 00 00 01 00 00 07 a9 [etadata.........]
      0077: 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 27 31 [<?xml version='1]
      0087: 2e 30 27 20 65 6e 63 6f 64 69 6e 67 3d 27 55 54 [.0' encoding='UT]
      0097: 46 2d 38 27 3f 3e 0a 3c 6d 65 74 61 64 61 74 61 [F-8'?>.<metadata]
      [snip 2233 bytes]
  + [Parasites directory, 2313 bytes]
  | XML (SubDirectory) -->
  | - Tag 'gimp-image-metadata' (1961 bytes):
  |     0020: 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 27 31 [<?xml version='1]
  |     0030: 2e 30 27 20 65 6e 63 6f 64 69 6e 67 3d 27 55 54 [.0' encoding='UT]
  |     0040: 46 2d 38 27 3f 3e 0a 3c 6d 65 74 61 64 61 74 61 [F-8'?>.<metadata]
  |     0050: 3e 0a 20 20 3c 74 61 67 20 6e 61 6d 65 3d 22 45 [>.  <tag name="E]
  |     0060: 78 69 66 2e 49 6d 61 67 65 2e 42 69 74 73 50 65 [xif.Image.BitsPe]
  |     [snip 1881 bytes]
  | + [XML directory, 1961 bytes]
  | | [adding XML:metadataTagName]
  | | MetadataTagName = Exif.Image.BitsPerSample
  | | - Tag 'metadata/tag/name'
  | | [adding XML:metadataTag]
  | | MetadataTag = 8 8 8
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Exif.Image.ImageLength
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 1050
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Exif.Image.ImageWidth
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 2100
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Exif.Image.ResolutionUnit
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 2
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Exif.Image.XResolution
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 72/1
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Exif.Image.YResolution
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 72/1
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Byline
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Creator1 (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.BylineTitle
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Creator's Job Title  (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Caption
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = The description aka caption (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.City
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = City (Core) (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Copyright
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Copyright (Notice) 2017.1 IPTC - www.iptc.org  (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.CountryCode
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = R17
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.CountryName
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Country (Core) (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Credit
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Credit Line (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.DateCreated
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 2017-07-13
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Headline
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = The Headline (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Keywords
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Keyword1ref2017.1
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.ObjectAttribute
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = A Genre (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.ObjectName
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = The Title (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.ProvinceState
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Province/State (Core) (ref2017.1
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.RecordVersion
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 4
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Source
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Source (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.SpecialInstructions
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = An Instruction (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.SubLocation
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Sublocation (Core) (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Subject
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = IPTC:1ref2017.1
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.TimeCreated
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = 17:01:00+00:00
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.TransmissionReference
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Job Id (ref2017.1)
  | | - Tag 'metadata/tag'
  | | MetadataTagName = Iptc.Application2.Writer
  | | - Tag 'metadata/tag/name'
  | | MetadataTag = Description Writer (ref2017.1)
  | | - Tag 'metadata/tag'
  | JpegSettings = .P.......
  | - Tag 'jpeg-settings' (10 bytes):
  |     07e3: 03 50 03 00 02 02 01 01 01 01                   [.P........]
  | ImageGrid = (style solid).(fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)[snip]
  | - Tag 'gimp-image-grid' (256 bytes):
  |     0809: 28 73 74 79 6c 65 20 73 6f 6c 69 64 29 0a 28 66 [(style solid).(f]
  |     0819: 67 63 6f 6c 6f 72 20 28 63 6f 6c 6f 72 2d 72 67 [gcolor (color-rg]
  |     0829: 62 61 20 30 2e 30 30 30 30 30 30 20 30 2e 30 30 [ba 0.000000 0.00]
  |     0839: 30 30 30 30 20 30 2e 30 30 30 30 30 30 20 31 2e [0000 0.000000 1.]
  |     0849: 30 30 30 30 30 30 29 29 0a 28 62 67 63 6f 6c 6f [000000)).(bgcolo]
  |     [snip 176 bytes]


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

zylstra

Quote from: carlseibert on August 20, 2018, 05:21:23 PMHmmm. This is interesting. I do see that 2.10.x is to include full support for metadata in WEBPs. That's something to celebrate when it happens!
We're on version 12.37 now and it hasn't happened yet...

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).