Adding private tags to a tiff file.

O

O Evans

Hi there,

I'm manipualating tiff images captured by a program that insists on
using annoying private tags. I want to be able to import an image that
I have created into the program but I cannot get PIL to save the
private tag. Here is a simplified version of the code I am using:

import Image
original = Image.open(r"test.tif")
original.tag[34118] = "life"
print "Before saving" , original.tag[34118]
original.save("test2.tif")
altered = Image.open(r"test2.tif")
if altered.tag.tagdata.has_key(34118):
print "It worked!"

Is there a way of getting this to work? I have tried looking at
TiffTags and TiffImageFile, but I cannot understand why the tags are
not preserved. Or should I be looking at a different library?

Many thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top