Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug): RoD seems to be not aligned to the exr datawindow with negative origin #996

Closed
6 of 10 tasks
bhack opened this issue Aug 13, 2024 · 1 comment
Closed
6 of 10 tasks
Labels
type:bug Something isn't working

Comments

@bhack
Copy link

bhack commented Aug 13, 2024

Make sure to follow our issue report guidelines

  • I'm using the latest version of Natron (not required but recommended)
  • I've restarted Natron and the issue persists
  • I've run Natron via the command line and the issue persists
  • I've followed the contributing guidelines to the best of my understanding
  • My issue is not on the issue tracker or in a pull request already (go search for it and dig around a little bit!)
  • This bug is reproducible

Natron version

2.5.0

Operating system

Ubuntu

System specs

No response

Did you install Natron using the official installer?

  • Yes, I used the official installer
  • No, I installed from a binary archive
  • No, I compiled Natron from sources
  • No, I installed Natron via another method

Custom installation path

No response

What were you trying to do?

Reading an exr with negative origin datawindow and attach it to the viewer node.

What did you expect to happen? What happened instead?

Reading this exr and attaching the image read node to the viewer I've expected that the calcularted RoD respect exr datawindow.
Instead the RoD it is not aligned to the specified datawindow

Step-by-step reproduction instructions

  1. Start Natron

  2. Use an Image->Read node to read the attached exr in the zip:
    checkerboard.zip

  3. Attach it to the viewer

  4. You will find that the RoD doesn't respect exr datawindow

Additional details

No response

@bhack bhack added the type:bug Something isn't working label Aug 13, 2024
@devernay
Copy link
Member

The EXR has:

  displayWindow: [ 0, 0 - 3199 1799 ] 3200 x 1800
  dataWindow: [ -40, -11 - 3214 1822 ] 3255 x 1834

Now remember that exr boxes start at top left, and OpenFX at bottom left so we need to flip the bbox relative to the frame (see code).
So the OpenFX RoD should be:

left=-40,bottom=-23,right=3215,top=1811

why is right not 3214 as in the datawindow? Because 3214 is the last pixel coordinate in EXR, and the OpenFX bound is 3215. For example, an EXR datawindow of (0,0,0,0) is a 1-pixel image and has an OpenFX RoD of (0,0,1,1).

Natron says:

left = -41 bottom = -24 right = 3216 top = 1812

So it adds one pixel in every direction, and the reason is that edgePixels is Auto by default, which adds a black border in this case:
image
If you set edgePixels to Repeat, you get exactly the EXR dataWindow as the RoD.
image

devernay added a commit to NatronGitHub/openfx-io that referenced this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants