2

I've run into an issue where there are a collection of .dds(direct draw surface) files which I need to be able to display within an electron/react app. From what I know, a .dds file must be converted to a png/jpeg before being able to be rendered in an img tag. This must also be done completely in memory as I don't want to create additional files.

Here is what I've tried.

Preview-DDS: https://github.com/Jam3/preview-dds
DDS-Parser: https://github.com/Jam3/parse-dds

I noticed Preview-DDS has an option to convert .dds to .png yet I had no luck replicating it in memory. This isn't a subject im really knowledgable on so I'm hoping someone can get me pointed in the right direction!

Reinier Torenbeek
  • 16,669
  • 7
  • 46
  • 69
Rykuno
  • 458
  • 3
  • 14
  • 1
    For in-memory conversion, I'd stick to parse-dds there, but given its limited support and the relative simplicity of DDS binary format, you might be better off implementing your own conversion by studying the [DDS file format](https://learn.microsoft.com/en-us/windows/desktop/direct3ddds/dx-graphics-dds-pguide#dds-file-layout) for yourself. – Patrick Roberts Dec 28 '18 at 18:23
  • 1
    You’re right and thanks. I started this morning on building from scratch with the help of parse-dds and got it working miraculously. Working today to get an Npm package for it out since I’ve seen many other people asking the same question upon my googling for a solution. – Rykuno Dec 28 '18 at 20:07

0 Answers0