problems modifying a tag ... help!

Started by joehill, April 19, 2012, 04:56:51 PM

Previous topic - Next topic

joehill

I am a complete exiftool newbie and am trying to use exiftool to modify metadata in a jpeg 2000 file ... here is my input:


exiftool -v test.jp2

and here is the output:


LOADED!
  ExifToolVersion = 8.88
  FileName = test.jp2
  Directory = .
  FileSize = 52651
  FileModifyDate = 1334852886
  FilePermissions = 33216
  FileType = JP2
  MIMEType = image/jp2
  + [JP2 directory]
  | FileType (SubDirectory) -->
  | + [BinaryData directory, 12 bytes]
  | | MajorBrand = jp2
  | | MinorVersion =
  | | CompatibleBrands = jp2
  | JP2Header (SubDirectory) -->
  | + [JP2Header directory]
  | | ImageHeader (SubDirectory) -->
  | | + [BinaryData directory, 14 bytes]
  | | | ImageHeight = 480
  | | | ImageWidth = 752
  | | | NumberOfComponents = 1
  | | | BitsPerComponent = 7
  | | | Compression = 7
  | | ColorSpecification (SubDirectory) -->
  | | + [BinaryData directory, 7 bytes]
  | | | ColorSpecMethod = 1
  | | | ColorSpecPrecedence = 0
  | | | ColorSpecApproximation = 0
  | | | ColorSpace = 17
  | XML (SubDirectory) -->
  | + [XMP directory, 955 bytes]
  | | [adding XMP:imageCreationGeneralCreationInfoCreationTime]
  | | ImageCreationGeneralCreationInfoCreationTime = 2012-04-02T11:53:09
  | | [adding XMP:imageCreationGeneralCreationInfoImageSource]
  | | ImageCreationGeneralCreationInfoImageSource = Digital Camera
  | | [adding XMP:imageCreationGeneralCreationInfoSceneType]
  | | ImageCreationGeneralCreationInfoSceneType = Original Scene
  | | [adding XMP:imageCreationCameraCaptureCameraInfoModel]
  | | ImageCreationCameraCaptureCameraInfoModel = VSD-380 [Imager: MT9V024]
  | | [adding XMP:imageCreationCameraCaptureCameraInfoSerial]
  | | ImageCreationCameraCaptureCameraInfoSerial = 00:18:76:01:74:79
  | | [adding XMP:imageCreationCameraCaptureCameraInfoVersion]
  | | ImageCreationCameraCaptureCameraInfoVersion = 00.04
  | | [adding XMP:imageCreationCameraCaptureSoftwareInfoVersion]
  | | ImageCreationCameraCaptureSoftwareInfoVersion = D00.06
  | | [adding XMP:imageCreationCameraCaptureCameraSettingsRExpTime]
  | | ImageCreationCameraCaptureCameraSettingsRExpTime = 31/1000
  | | [adding XMP:imageCreationCameraCaptureCameraSettingsCameraLocationCoordLocTimestamp]
  | | ImageCreationCameraCaptureCameraSettingsCameraLocationCoordLocTimestamp = 2012-04-02T11:51:53
  | | [adding XMP:imageCreationCameraCaptureCameraSettingsCameraLocationCoordLocLongitude]
  | | ImageCreationCameraCaptureCameraSettingsCameraLocationCoordLocLongitude = -77.379150
  | | [adding XMP:imageCreationCameraCaptureCameraSettingsCameraLocationCoordLocLatitude]
  | | ImageCreationCameraCaptureCameraSettingsCameraLocationCoordLocLatitude = +38.964931
  | | [adding XMP:imageCreationCameraCaptureCameraSettingsCameraLocationCoordLocAltitude]
  | | ImageCreationCameraCaptureCameraSettingsCameraLocationCoordLocAltitude = 120.900
  | - Tag 'jp2c' (offset 0x0418 to end of file)



I am trying to modify the imageCreationGeneralCreationInfoCreationTime tag but am unable to do so ... when I enter

exiftool -s -ImageCreationGeneralCreationInfoCreationTime= test.jp2

I get


Warning: Tag 'ImageCreationGeneralCreationInfoCreationTime' does not exist
Nothing to do.

Do I have to add this tag in the config file?  (if so, how would I do that?)  thanks in advance ...


Joe

Phil Harvey

#1
Hi Joe,

It is preferable to write a standardized tag if possible.  See the JPEG 2000 tags or the XMP tags documentation for a list of standard tags which may be written.

I guess I'm a bit confused as to why you want to write this specific tag.  In general, adding arbitrary user-defined JPEG 2000 tags isn't a good idea.

- Phil

Edit:  Oh.  I just checked your -v output.  Creating new user-defined XMP tags is certainly possible, however this looks to be a rather complex structure, so it will be tricky.  Do you just want to write this one tag?  Or do you want to delete this information?  Or do you want to copy all this information to another JPEG 2000 image?  The last 2 don't require user-defined tags.  If you do want to write individual tags, then post the output of -xmp -b for this image and I can help you with the config file.
...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 ($).

joehill

Phil ...

thanks so much for your reply ... there are a few tags that I need to modify as these tags are read by other routines ... the output of -xmp -b is:

bash-3.2$ exiftool -xmp -b test.jp2
LOADED!
<?xml version="1.0" encoding="UTF-8"?>
<IMAGE_CREATION>
  <GENERAL_CREATION_INFO>
    <CREATION_TIME>2012-04-02T11:53:09</CREATION_TIME>
    <IMAGE_SOURCE>Digital Camera</IMAGE_SOURCE>
    <SCENE_TYPE>Original Scene</SCENE_TYPE>
  </GENERAL_CREATION_INFO>
  <CAMERA_CAPTURE>
    <CAMERA_INFO>
      <MODEL>VSD-380 [Imager: MT9V024]</MODEL>
      <SERIAL>00:18:76:01:74:79</SERIAL>
      <VERSION>00.04</VERSION>
    </CAMERA_INFO>
    <SOFTWARE_INFO>
      <VERSION>D00.06</VERSION>
    </SOFTWARE_INFO>
    <CAMERA_SETTINGS>
      <R_EXP_TIME>31/1000</R_EXP_TIME>
      <CAMERA_LOCATION>
        <COORD_LOC TIMESTAMP="2012-04-02T11:51:53">
          <LONGITUDE>-77.379150</LONGITUDE>
          <LATITUDE>+38.964931</LATITUDE>
          <ALTITUDE>120.900</ALTITUDE>
        </COORD_LOC>
      </CAMERA_LOCATION>
    </CAMERA_SETTINGS>
  </CAMERA_CAPTURE>
</IMAGE_CREATION>
<!-- JPEG 2000 Schema Documentation: http://www.jpeg.org/metadata/15444-2.PDF -->


Phil Harvey

Darn.  Unfortunately you are out of luck.  This isn't XMP (which is a particular flavour of RDF/XML).  Instead, it is a JPEG2000-specific format of XML.

ExifTool doesn't write arbitrary XML formats.  It is too bad that JPEG2000 didn't standardize on XMP like everyone else.

- 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 ($).

joehill

Phil ... thanks ... do you happen to have any ideas on how I might approach this problem using other tools?

Joe

Phil Harvey

Hi Joe,

Honestly, I doubt there is any software out there that would do this unless you can find something produced by the JPEG 2000 developers themselves.

Instead, it may make more sense to write XMP to the JP2.  At least then you have a better chance of finding other software that can deal with this information.

- 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 ($).