jamesbowman/openexrpython

Modifying header silently fails

melMass opened this issue · 10 comments

Hi,

I'm not sure what I'm doing wrong, we received a batch of ACES EXR files made from *.ari raws.
For some reason the metadatas are wrong, the image is 2880x2160 but considerer as 1.0 pixel aspect (should be 2.0 for ana).
We wanted to batch edit those using those bindings but it fail without erroring out. Is it related to ACES Exr, or Ari metadatas ?

Here is a sample based on the examples:

import OpenEXR
f = "A024C008_170506_R0VT.0005885.exr"
ex = OpenEXR.InputFile(f)
h = ex.header()
channels = h['channels'].keys()
newchannels = dict(zip(channels, ex.channels(channels)))
h["pixelAspectRatio"] = 2.0
h["comments"] = "edited EXR ACES from ARI to match the ANAMORPHIC ASPECT RATIO while retaining full pixels."

out = OpenEXR.OutputFile("out.exr",h)
out.writePixels(newchannels)
out.close()

Any idea ?

Thanks

The code fails on OpenEXR.OutputFile() using a dummy header works so something is not working while transfering the header.

Trying the same operations on one of the standard image works fine, so seems that something in the original exr's header is causing the problem.

Please can you show h? Or if possible attach one of the images?

>>> import OpenEXR
>>> f = "GoldenGate.exr"
>>> ex = OpenEXR.InputFile(f)
>>> h = ex.header()
>>> channels = h['channels'].keys()
>>> newchannels = dict(zip(channels, ex.channels(channels)))
>>> h["pixelAspectRatio"] = 2.0
>>> h["comments"] = "edited EXR ACES from ARI to match the ANAMORPHIC ASPECT RATIO while retaining full pixels."
>>> out = OpenEXR.OutputFile("out.exr",h)
>>> out.writePixels(newchannels)
>>> out.close()

Thanks.

Here is the full pprint of h (remove serial numbers and such):

 'compression': NO_COMPRESSION,
 'dataWindow': (0, 0) - (2879, 2159),
 'displayWindow': (0, 0) - (2879, 2159),
 'expTime': 0.005555999930948019,
 'framesPerSecond': '25000/1000 (25.000)',
 'imageCounter': 405885,
 'imageRotation': 0.0,
 'interim.camera.shutterAngle': 180.0,
 'interim.camera.wbKelvin': 5600,
 'interim.clip.cameraClipName': b'A004C008_170506_R0VT',
 'interim.clip.takeName': b'C008',
 'isoSpeed': 800.0,
 'lineOrder': INCREASING_Y,
 'originalImageFlag': 1,
 'pixelAspectRatio': 1.0,
 'recorderFirmwareVersion': b'2014.SIM2.3201',
 'recorderMake': b'Codex Digital',
 'recorderModel': b'SIM2',
 'reelName': b'A004R0VT',
 'screenWindowCenter': (0.0, 0.0),
 'screenWindowWidth': 1.0,
 'storageMediaSerialNumber': b'blablablabla',
 'timeCode': <Imath.TimeCode instance { time: 4:30:35:10, dropFrame: 0, colorFrame: 0, fieldPhase: 0, bgf0: 0, bgf1: 0, bgf2: 0,
 'timecodeRate': 25,
 'utcOffset': 0.0}

They are EXR outputs from Arri's ARC_CMD which is the official converter from *.ari to ACES Compliant EXR's

hmm I realise the main dict header is not closed (missing a last {}), is that normal

Hard to say what's happening. That header looks fine.
You can send me a problem .exr privately - jamesb@excamera.com

Thanks, I've sent it using https://fromsmash.com/ the link will last 2 days.

Did you managed to deal with the sent exr ?

No I did not receive the email :'(

OK... please mail me directly at jamesb@excamera.com and we'll continue there