Comments (4)
Have you tried exrstdattr
instead of OIIO? That's much faster and less memory intensive because it doesn't decode the pixel data, just writes a new header then copies the compressed image data chunks into the new file. You would need to create a temp file then rename over the original, but that can be used to guarantee you don't end up with a corrupt file if the metadata modification gets interrupted.
It could be possible to modify attributes in place in the header, but only if they stay exactly the same size, and you can't insert, remove or rename attributes that way. If the header size changes, any tool would have to move the rest of the file by reading it in and writing it back out, which is what exrstdattr does anyway.
from openexr.
Yes, the idea is similar to ffmpeg, where you can simply "copy" the channels from one file to another without writing every pixel again.
This would also help when using files compressed with DWAA and DWAB, so you do not recompress a lossy image.
from openexr.
Somebody just added that to oiio trunk (copy without decode for exr files), though it doesn't yet work for the exrcore code path.
But back to the original question -- I'm not sure you could do this without an incompatible change to the file format, but you could imagine a change to the exr file layout spec itself that would make it more amenable to adding metadata "in place" in an existing file.
from openexr.
there is a stubbed function in the core to support in-place edit of metadata (provided you do not change the length of strings or add values, but just updating a float or whatever). However, it is not yet finished, but was a desired tool to finish at some point! You can more easily do the copy without any decode with core, in that there are direct "chunk" read / write routines, completely skipping any decode / encode path, which you'll see me using in the rawPixel-ish functions in the cpp rewrite branch I'm working on currently. Would be lovely to have some contributors
from openexr.
Related Issues (20)
- [Need suggestions/recommendations] OpenEXR for high-speed images grabbing application scenario. HOT 7
- Bazel install target HOT 10
- fatal clang-format error on macOS can't upgrade/install via Homebrew HOT 13
- Cross-compiler target linking failure HOT 1
- Uninitialized sliceOptimizationData::type HOT 2
- [Usage recommendation request] Decompressing large EXRs in real-time. HOT 4
- OpenEXR.OutputFile Fails to Write to BytesIO Buffer HOT 1
- Install openexr 3.2.4 to macOS Big Sur 11.7.10 HOT 9
- Unit tests fail when building UB2 binaries on Mac. HOT 1
- CMP0107 issue
- OpenEXR static build not creating libIlmImf.a HOT 5
- Chromaticities should be a required attribute HOT 7
- terminate called after throwing an instance of `Iex_3_2::EioExc` in `OpenEXR.InputFile.channels` HOT 1
- AppleClang compiler warning with C++17
- std::atomic_*() overloads for shared_ptr are deprecated in C++20
- writing image from Python wrapper with xDensity gives "unknown attribute" warning
- Building OpenEXR with Python bindings HOT 1
- Add python support for the IDManifestAttribute
- Add proper python support for reading/writing header only
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 openexr.