jpegview icon indicating copy to clipboard operation
jpegview copied to clipboard

DDS format support

Open Anutim opened this issue 1 year ago • 12 comments

Hey, just wanted request DDS support incase anyone might be interested in adding support for it. It's the last format I commonly use that I can't use jpegview for.

Anutim avatar Jul 30 '24 11:07 Anutim

Hi @Anutim, not sure if this is still something you need, but I've opened a PR which adds DDS support for most sub-formats. Do let me know if this helps you out!

Raghav-B avatar Jan 04 '25 09:01 Raghav-B

Hi @Anutim, not sure if this is still something you need, but I've opened a PR which adds DDS support for most sub-formats. Do let me know if this helps you out!

I don't have Visual Studio installed so can't test it as is, but that is fantastic!

And it's still definitely something I'd want. While Windows Explorer supports previews for DDS in general, it's still pretty awkward incase I have to zoom in on some detail. Explorer also doesn't support previewing 888/8888 etc, so would definitely be great with that too even if use of them is quite rare.

Anutim avatar Jan 04 '25 14:01 Anutim

It would be great if you could test it out since the DDS build has been very useful for my work. Hmm, I could create a custom release on my fork with a binary you could download? Not sure if that's something you would be comfortable with however.

Raghav-B avatar Jan 15 '25 00:01 Raghav-B

I'll take a look at it and merge it. I'm due for a release. I originally wanted to sign it but maybe I'll just leave it unsigned for one more release and just put the PRs in

Thanks for the contribution. I'm sorry I've been kinda MIA for a few months

sylikc avatar Jan 15 '25 03:01 sylikc

No worries @sylikc, just happy to contribute to something I use daily! I've marked #352 as draft for now since I want to be thorough and ensure it works with all the DDS formats listed in the PR description. Will probably have it done over the weekend.

Raghav-B avatar Jan 15 '25 03:01 Raghav-B

It would be great if you could test it out since the DDS build has been very useful for my work. Hmm, I could create a custom release on my fork with a binary you could download? Not sure if that's something you would be comfortable with however.

Yeah, sure, I'd appreciate it!

EDIT: Oh, I might as well wait actually if y'all are merging it soon.

Anutim avatar Jan 17 '25 16:01 Anutim

Any update on this? @Raghav-B

Anutim avatar Feb 26 '25 20:02 Anutim

Hi @Anutim . Sorry about the delay. Got caught up with work and also dealing with the fact that there are basically 100+ DDS subformats. I'm currently validating whether its worth supporting all of these before I decide to finalize the PR.

As mentioned in the PR, it can already handle all the DDS formats possible in Python Pillow. Perhaps this is enough for your use case - though do let me know if you have issues with certain files. Here is a release I've pushed out that matches the Pillow standard.

Hopefully I can add support for the other subformats and have this merged into the main repo soon...

EDIT: There is one known issue I identified with my existing implementation: I'm actually not adjusting the gamma when rendering non-sRGB DDS images - causing some to appear darker than expected. Will work on this fix as well.

Raghav-B avatar Feb 27 '25 13:02 Raghav-B

Hi @Anutim . Sorry about the delay. Got caught up with work and also dealing with the fact that there are basically 100+ DDS subformats. I'm currently validating whether its worth supporting all of these before I decide to finalize the PR.

As mentioned in the PR, it can already handle all the DDS formats possible in Python Pillow. Perhaps this is enough for your use case - though do let me know if you have issues with certain files. Here is a release I've pushed out that matches the Pillow standard.

Hopefully I can add support for the other subformats and have this merged into the main repo soon...

Thank you, and take your time, I just wanted to check in.

Though, would it be possible to add a portable zip file in the release instead of an MSI?

Anutim avatar Feb 27 '25 13:02 Anutim

Sure, I've just added it to the release @Anutim :)

Raghav-B avatar Feb 27 '25 13:02 Raghav-B

As mentioned in the PR, it can already handle all the DDS formats possible in Python Pillow. Perhaps this is enough for your use case - though do let me know if you have issues with certain files.

So far it's working great with every format I've tried, and loads the files really fast as well! (Which is great, since speed is by far my favourite thing about jpegview)

Anutim avatar Feb 27 '25 23:02 Anutim

So far it's working great with every format I've tried, and loads the files really fast as well! (Which is great, since speed is by far my favourite thing about jpegview)

That's awesome to hear :) Hope once its merged in it'll be useful for others as well

Raghav-B avatar Feb 28 '25 16:02 Raghav-B

So far it's working great with every format I've tried, and loads the files really fast as well! (Which is great, since speed is by far my favourite thing about jpegview)

That's awesome to hear :) Hope once its merged in it'll be useful for others as well

It seems not to work properly on the following sample files: https://www.samplefiles.org/download-dds-sample-files/#download I can't figure it out...

For0xLC avatar Nov 01 '25 13:11 For0xLC

It seems not to work properly on the following sample files: samplefiles.org/download-dds-sample-files#download I can't figure it out...

I'll try to dedicate some time by next weekend to look into this. Thanks for sending these files

Raghav-B avatar Nov 02 '25 03:11 Raghav-B

Had a quick look at this just now @For0xLC . It seems like that website just downloads 0-byte empty files?

Image

Raghav-B avatar Nov 02 '25 05:11 Raghav-B

Had a quick look at this just now @For0xLC . It seems like that website just downloads 0-byte empty files?

Image

Oh no, sorry, I pasted the wrong link yesterday. https://filesamples.com/formats/dds

For0xLC avatar Nov 02 '25 05:11 For0xLC

Oh no, sorry, I pasted the wrong link yesterday. filesamples.com/formats/dds

Actually I am curious, how did you come across these failing cases? Do these sample files mirror DDS files you're using at present?

Raghav-B avatar Nov 02 '25 05:11 Raghav-B

Oh no, sorry, I pasted the wrong link yesterday. filesamples.com/formats/dds

Actually I am curious, how did you come across these failing cases? Do these sample files mirror DDS files you're using at present?

I rarely work with DDS format. I was testing your code, and found these DDS files on Google Search. They can be viewed in Imagine, IrfanView and Windows Photo Viewer but JpegView. I've tried to debug it in VS2022, but I can't understand the code in BcnDecode.cpp...

For0xLC avatar Nov 02 '25 06:11 For0xLC