woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
884 stars 41 forks source link

Unable to open various ktx2 files #405

Open ivanceras opened 1 month ago

ivanceras commented 1 month ago

Describe the bug

[2024-07-20T20:02:14Z ERROR oculante::utils] KTX2: Unsupported format: Etc2Rgb8UnormSrgb. Please open a github issue and attach your image. [2024-07-20T20:03:14Z ERROR oculante::utils] KTX2: Unsupported format: R32Float. Please open a github issue and attach your image. [2024-07-20T20:04:19Z ERROR oculante::utils] KTX2: Unsupported format: Rgb9e5Ufloat. Please open a github issue and attach your image.

Attached here is one sample ktx2 files.

pisa_diffuse_rgb9e5_zstd.zip

There are also more ktx2 files found hereenvironment_maps

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Browse Image'
  2. Click on 'any ktx2 image'
  3. See error popups

Expected behavior A clear and concise description of what you expected to happen.

Screenshots / sample files If applicable, add screenshots to help explain your problem. You can also attach problematic images here to help test the bug. Please pay attention to image copyright.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

woelper commented 1 month ago

Hi and thanks for the report!

You are of course right here. In general, KTX seems to be quite a complex format, and supporting all variants is lots of work.

There was no good KTX library when I last checked, so I took a lot of logic from Bevy's KTX loader. In the end, I need to fully decode the image format to allow editing, where Bevy and other engines can pass the compressed data directly to the GPU, which I can't do (yet). So there will always be less support for now.

Your particular request looks like something that could potentially be fixed, with the exception of Etc2Rgb8UnormSrgb which is likely a hardware compressed format that I don't have a decoder for - the format is designed to be uploaded to the GPU and I am not aware of a library to decode it yet.

ivanceras commented 1 month ago

@woelper Thank you for your work on this project. I didn't know the ktx2 format is little more complicated than the common image formats around. No wonder there aren't much image viewer that works with kt2x.