title: Write EXIF-data from TIF (read with exifread) to JPEG-file using PIL (Pillow)
body: <p>I'm writing a function that does some specialized image manipulation and saves the image in JPEG format. Naturally, the metadata should be preserved as much as possible. I'm using PIL (Pillow) and succeeded to do it with JPEG files as input data, since PIL is able to read the EXIF-data in this case.</p>
  
  <p>However, for TIF images the info-dictionary does not contain an 'exif'-key. Using the module exifread, reading the exif data works fine, like so</p>
  
  <pre><code>import exifread
  f = open('tifimage.tif')
  img_exif = exifread.process_file(f)
  f.close()
  </code></pre>
  
  <p>Now I'd like to pass this exif-data to PIL when saving, e.g.</p>
  
  <pre><code>img.save(filename, "JPEG", exif = img_exif)
  </code></pre>
  
  <p>But I cannot find out how to format the exif data properly, since they come in as dict type from exifread, but need to be in raw-string format or read-only-buffer for PIL.</p>
  
  <p>Any help is highly appreciated!</p>