pombreda / python-xmp-toolkit

Automatically exported from code.google.com/p/python-xmp-toolkit
Other
0 stars 1 forks source link

Own xmp #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Cannot add own xmp tag with

What steps will reproduce the problem?

When i try
xmpfile = 
XMPFiles(file_path="/file/configs/pdf/pdf13.pdf",open_forupdate=files.XMP_OPEN_F
ORUPDATE)
xmp = xmpfile.get_xmp()
xmp.set_property("http://my-networks.com/xmp/private/",'ecq:Original_FileName','
reference 
file.pdf')
xmpfile.put_xmp(xmp)
xmpfile.close_file() 

i get this :
Unregistered schema namespace URI
and the file isn't updated.

If i take a pdf and put my own xmp with acrobat on then use
this pdf to correct xmp they works !!

But if i'm trying to put value with variable in xmp.set_property
exemple:
xmpfile = 
XMPFiles(file_path="/file/configs/pdf/pdf13.pdf",open_forupdate=files.XMP_OPEN_F
ORUPDATE)
xmp = xmpfile.get_xmp()
NameSpace = "http://my-networks.com/xmp/private/"
ValueName = 'ecq:Original_FileName'
ValueVal = 'reference file.pdf'
xmp.set_property(NameSpace,ValueName,ValueVal)
xmpfile.put_xmp(xmp)
xmpfile.close_file() 
i get this :
Unregistered schema namespace URI
and the file isn't updated.

What version of the product are you using? On what operating system?
exempi-2.1.1
python-xmp-toolkit-1.0-rc1
RHEL5
Linux 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST 2009 x86_64 x86_64 
x86_64 
GNU/Linux

Please provide any additional information below.

Original issue reported on code.google.com by cedric.o...@gmail.com on 13 Jan 2010 at 2:59

GoogleCodeExporter commented 9 years ago
oups i forgot
Python 2.6.4 (r264:75706, Dec  7 2009, 20:32:28) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2

Original comment by cedric.o...@gmail.com on 13 Jan 2010 at 3:01

GoogleCodeExporter commented 9 years ago
to register a new namespace
add
xmp.register_namespace("http://my-networks.com/xmp/private/","ecq")
after
xmp = xmpfile.get_xmp()

they should be work ;-))

Original comment by cedric.o...@gmail.com on 19 Jan 2010 at 5:36

GoogleCodeExporter commented 9 years ago
Hey,

Glag you figured out how to do it. What I'll do is to get in documented in a 
FAQ or similar in the documentation, 
so that it should be easier for others in the future.

Thanks for your report,
Lars

Original comment by lniel...@spacetelescope.org on 17 Feb 2010 at 12:47