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

Image API do not support hdr/exr #854

Closed
mwestphal opened this issue Jun 14, 2023 · 3 comments · Fixed by #858
Closed

Image API do not support hdr/exr #854

mwestphal opened this issue Jun 14, 2023 · 3 comments · Fixed by #858
Milestone

Comments

@mwestphal
Copy link
Contributor

Image API do not support hdr/exr

f3d::image("path/to/file.hdr")
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3d6cd37 in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff3d6cd37 in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff46c4e9a in vtkImageExport::Export (this=0x5555555d0ec0, output=0x7ffff347c010) at /home/glow/dev/vtk/vtk1/src/IO/Image/vtkImageExport.cxx:147
#2  0x00007ffff46948bf in f3d::image::internals::SetFromVTK (this=0x5555555da750, alg=0x5555555d0290) at /home/glow/dev/f3d/f3d/src/library/src/image.cxx:55
#3  0x00007ffff4693ba7 in f3d::image::image (this=0x7fffffffd1a0, path="/home/glow/dev/f3d/f3d/src/testing//data/palermo_park_1k.hdr") at /home/glow/dev/f3d/f3d/src/library/src/image.cxx:84
#4  0x0000555555567dca in TestSDKImage (argc=4, argv=0x7fffffffe7a0) at /home/glow/dev/f3d/f3d/src/library/testing/TestSDKImage.cxx:49
#5  0x000055555555af07 in main (ac=4, av=0x7fffffffe7a0) at /home/glow/dev/f3d/f3d/build/library/testing/libf3dSDKTests.cxx:282
@mwestphal mwestphal added this to the 2.1.0 milestone Jun 14, 2023
@Meakk
Copy link
Member

Meakk commented Jun 15, 2023

I checked. We assume that the scalar type is byte. In the case of HDR and EXR it's float.

@mwestphal
Copy link
Contributor Author

So should we fix it ?

Should we guess the format or provide an API for it ?

@Meakk
Copy link
Member

Meakk commented Jun 15, 2023

We can get the scalar size from the vtkImageData and either convert it to 8-bits (and clamp to 0~1 if it's a float), or extend f3d::image to support wider scalars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants