Comments (18)
The workflow of class pyexiv2.Image
is as follows:
- Read the image from disk
- Modify the image in memory
- Save the image from memory to disk
While class pyexiv2.ImageData
is used to open and save images in memory.
How do you create xmp_file_obj in your code?
from pyexiv2.
Can your code successfully handle other images that are less than 1.5g?
from pyexiv2.
Thanks for the clear rundown. Yes! Lower resolution images work perfectly, and I've appended metadata (XMP tags) to ~700mb JPEG's before. I forgot the line of code for xmp_file_obj (my bad, copied and pasted the pieces separately), so here's the full piece:
final_image_filename = outfile or (info.image_name + '.jpg')
img.save(final_image_filename, quality=quality, subsampling=0)
dir_path = os.path.dirname(os.path.realpath(__file__)) + '\\' + final_image_filename
print(dir_path)
xmp_file_obj = TaggedImage(dir_path) ##xmp_file_obj defined here
for key, value in info.metadata.items():
try:
xmp_file_obj.modify_xmp({key: value})
except RuntimeError as e:
print(f'Failed to add add XMP tag with key "{key}" with value "{value}"')
print(repr(e))
shutil.rmtree(tiles_dir)
print("Saved the result as " + final_image_filename)
Where taggedImage(dir_path)
is just the full path, with the image name appended to it. I don't think that's the issue as I tried xmp_file_obj = TaggedImage(final_image_filename)
which points to the same file, and returns the same error.
It's worth noting that 1.5gb is after JPEG compression... is it possible that the file is opened in memory uncompressed or something?
from pyexiv2.
I'm not familiar with the JPEG image format and don't know if it's greater than 1.5g in memory.
It is recommended that you save the 1.5g image separately to disk and see if you can open it with pyexiv2.
I get an exception when I use pyexiv2 to open images larger than 2g, but not the exception that you get.
from pyexiv2.
I just tried with the image saved to disk first, and modifying that directly (class pyexiv2.Image
was used).
No go, unfortunately, same error as before. Can I send you the file to check?
from pyexiv2.
I want to try opening your image, but how to send it to me?
from pyexiv2.
I'll give you a google drive link after it finishes uploading in a few minutes - does that work?
from pyexiv2.
How long will it take?If it is too late, I will deal with the problem in 24 hours.
from pyexiv2.
Not a problem, it's about halfway done by now. Not sure how late it is for you but it's expecting to be done in around 5-10 minutes.
from pyexiv2.
OK. I can wait another hour.
from pyexiv2.
The file can be accessed here. Let me know if you need access to the code that generates the XMP tags for testing.
from pyexiv2.
It takes me a few hours to download this image, so I'll process it in 20 hours.
from pyexiv2.
Sure, looking forward.
from pyexiv2.
The problem seems to be that Exiv2 cannot modify images larger than 1G. I am waiting for the confirmation from the Exiv2 developer.
Exiv2/exiv2#1248
from pyexiv2.
Thanks for the update! Let's hear what he says.
from pyexiv2.
So, I'm assuming pyexiv2 can only read the image less than 2G and modify the image less than 1G. But this feature has not been fully tested.
from pyexiv2.
Thanks for testing that out. I'll put a conditional in limiting to files 1gb or less.
from pyexiv2.
This issue has been automatically closed because there has been no activity for a month.
from pyexiv2.
Related Issues (20)
- Hi i am search for adding XMP tags to IPTC is it possible by any means ? HOT 3
- tif 图获取ICC Profile解码出错 HOT 6
- How to set Exif.Image.ImageID properties HOT 1
- XMP Toolkit error 201: Error in XMLValidator HOT 6
- Speed fluctuations in windows 11 HOT 3
- latest version 2.8.2 doesn't work on Ubuntu 20.04 HOT 3
- Python 3.12 wheels missing and no source release on PyPI HOT 3
- How to catch "bad metadata" vs no metadata HOT 3
- Err 2 HOT 8
- Large exif data HOT 2
- modify_xmp() errors with 'Composite nodes can't have values' HOT 5
- Auto register additional XMP namespaces HOT 4
- Support conversion HOT 2
- Open image with german umlauts HOT 4
- exiv2api.cpp will compile with exiv2 until version 0.27.7 HOT 3
- Copying exif data containing duplicate keys HOT 9
- Chinese Path Error!
- Modifying exif containing duplicate keys. HOT 10
- Does it support Python 3.10+? HOT 5
- Adding tag description access to pyexiv2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyexiv2.