syoyo / tinyexr

Tiny OpenEXR image loader/saver library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compilation error on 1.0.1 with ZFP

toge opened this issue · comments

commented

Describe the issue
Hi.
I met compilation error on 1.0.1 with ZFP.

.../include/tinyexr.h:6950:27: error: ‘exr_header’ was not declared in this scope; did you mean ‘exr_headers’?
 6950 |       for (int c = 0; c < exr_header->num_channels; ++c) {
      |                           ^~~~~~~~~~
      |                           exr_headers

To Reproduce
Steps to reproduce the behavior:

  1. Compile TinyEXR with 'TINYEXR_USE_ZFP=1'
  2. See error

Please attach minimal and reproducible files(source codes, EXR files, etc)

Expected behavior
Compilation success.

Environment

  • OS: Fedora Linux 37
  • Compiler gcc 12.2

Easy Patch
I success to compile with following patch:

-      for (int c = 0; c < exr_header->num_channels; ++c) {
+      for (int c = 0; c < exr_headers[i]->num_channels; ++c) {

Oh ZFP support is experimental and was not maintained for a while.

I also got other errors due to ZFP API changes.

clang++ -fsanitize=address -Wno-padded -Weverything -Werror -Wall -Wextra -std=c++11 -g -O0 -DTINYEXR_USE_PIZ=1 -DTINYEXR_USE_ZFP=1 -I./deps/ZFP/inc -I./deps/miniz -o test_tinyexr test_tinyexr.cc miniz.o -L./deps/ZFP/lib -lzfp
In file included from test_tinyexr.cc:20:
./tinyexr.h:3417:5: error: no matching function for call to 'zfp_stream_set_precision'
    zfp_stream_set_precision(zfp, param.precision);
    ^~~~~~~~~~~~~~~~~~~~~~~~
...

Easy Patch

Yes it should fix the issue. PR with this this path and also keeping up with recent ZFP API is much appreciated!

commented

@syoyo
Sure!
I try to create PR.