Giter Club home page Giter Club logo

Comments (6)

syoyo avatar syoyo commented on August 12, 2024

I have investigated your EXR file and offset tables looks corrupted.

http://www.openexr.com/openexrfilelayout.pdf (See page 10 for Offset tables)

First element of offset tables contains the byte offset to 1023th scanline correctly, but other elements are filled with zeros, so tinyexr reads pixel data from invalid location, resulting an assertion.

Also, exrheader program from OpenEXR displays your EXR is incomplete.

$ exrheader sample-tinyexr-bug.exr 

file sample-tinyexr-bug.exr (incomplete):

file format version: 2, flags 0x0
channels (type chlist):
    B, 16-bit floating-point, sampling 1 1
    G, 16-bit floating-point, sampling 1 1
    R, 16-bit floating-point, sampling 1 1
compression (type compression): run-length encoding
dataWindow (type box2i): (0 0) - (1023 1023)
displayWindow (type box2i): (0 0) - (1023 1023)
lineOrder (type lineOrder): increasing y
pixelAspectRatio (type float): 1
screenWindowCenter (type v2f): (0 0)
screenWindowWidth (type float): 1
type (type string): "scanlineimage"

How do you create your EXR file?

(For some reason, it looks OpenEXR can handle such an incomplete data, whereas tinyexr is not)

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

BTW I have found another issue related RLE, filed as #35

(FYI, offset tables in comp_rle.exr are correct, thus issue #35 looks purely the problem of RLE decoding)

from tinyexr.

zeroeffects avatar zeroeffects commented on August 12, 2024

The file was produced by a legacy toolchain, so I don't exactly have control over it. Anyway, I will see whether I can hack around the issue.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

I found OpenEXR try to reconstruct offset information for incomplete EXR file.
(i.e. offset is zero)

https://github.com/openexr/openexr/blob/develop/OpenEXR/IlmImf/ImfScanLineInputFile.cpp#L338

And adding similar code to tinyexr, now your file can be read correctly.

BTW, Is it ok to add your EXR file to unit tests? @zeroeffects

from tinyexr.

zeroeffects avatar zeroeffects commented on August 12, 2024

It seems that the latest version is crashing with null pointer dereference in rleDecompress.

Also, you can use the image. It is a rectified image of alcantara material measured in camera dome under specific lighting and viewing conditions.

from tinyexr.

syoyo avatar syoyo commented on August 12, 2024

Ah, I found memory bug and fixed it. Now recent master should work.

Also, you can use the image.

Thank you. But I found the image has 5.8MB which is too large to add into tinyexr repo. Do you have much more smaller one? (e.g. 0.5 MB or less)

from tinyexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.