title: Writing IPTC data to jpg file
body: <p>I would like to write IPTC data, such as title, description or keywords to an jpg file, but it does not work. If i run the sample code a second jpg file is writen, but no sample data. I am using the commons imaging library from Apache:
  <a href="http://commons.apache.org/proper/commons-imaging/" rel="nofollow">http://commons.apache.org/proper/commons-imaging/</a></p>
  
  <p>Here is the sample code:</p>
  
  <pre><code>TiffImageMetadata metadata = ((JpegImageMetadata)Imaging.getMetadata(new File(JPG_PATH +    
          "\\IMGP5996_empty.jpg"))).getExif();
  ExifRewriter rewriter = new ExifRewriter();
  TiffOutputSet outputSet = metadata.getOutputSet();
  TiffOutputDirectory exif = outputSet.getOrCreateExifDirectory();
  
  exif.add(MicrosoftTagConstants.EXIF_TAG_XPAUTHOR, "TEST_AUTHOR");
  exif.add(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT, "TEST_COMMENT");
  exif.add(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT, "TEST_SUBJECT");
  exif.add(MicrosoftTagConstants.EXIF_TAG_XPTITLE, "TEST_TITLE");
  exif.add(MicrosoftTagConstants.EXIF_TAG_XPKEYWORDS, "TEST_KEYWORD"); 
  
  FileOutputStream fos=new FileOutputStream(new File(JPG_PATH + "\\IMGP5996_empty-2.jpg"));
  rewriter.updateExifMetadataLossy(jpgFile, fos, outputSet);
  </code></pre>
  
  <p>Can anyone help me?</p>