Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm trying to change metadata of files with
iptcinfo3
but sometimes I get
error: 'H' format requires 0 <= number <= 65535
error at the line #1 when I'm trying to save it.
def changefiletags(filename,tags):
info = iptcinfo3.IPTCInfo(filename)
info['keywords'] = tags
info.save() #1
os.remove(filename+ '~')
How to avoid this?
by the way error full text:
File "F:\projects\pic downloader\sourcecode\imagedownloader2.py", line 44, in changefiletags
info.save()
File "C:\ProgramData\Anaconda3\lib\site-packages\iptcinfo3.py", line 627, in save
return self.save_as(self._filename, options)
File "C:\ProgramData\Anaconda3\lib\site-packages\iptcinfo3.py", line 670, in save_as
data = self.photoshopIIMBlock(adobe, self.packedIIMData())
File "C:\ProgramData\Anaconda3\lib\site-packages\iptcinfo3.py", line 940, in photoshopIIMBlock
out.append(pack("!H", len(resourceBlock) + 2)) # length
error: 'H' format requires 0 <= number <= 65535
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.