andburn / dds-reader Goto Github PK
View Code? Open in Web Editor NEW.NET core DDS reader and converter
License: MIT License
.NET core DDS reader and converter
License: MIT License
DDSImage.cs line 117: using of pixelformat.rgbbitcount unconditionally is wrong. Microsoft docu says "Number of bits in an RGB (possibly including alpha) format. Valid when dwFlags includes DDPF_RGB, DDPF_LUMINANCE, or DDPF_YUV." So, I have an dds-image with neither of these flags set and the rgbbitcount field is 0. This results in a zero-size-image - very hard to see ;)
Hi,
I want to use your code in another application that has a very old dds reader and is not updated or working anymore...
The question is how do i use your app into this function, how to call it:
private void DDSFile(FileRecord selectedRecord)
{
var buffer = selectedRecord.ReadData(path);
ImageOutput.Visibility = Visibility.Visible;
//var dds = new DDSImage(buffer);
using (var ms = new MemoryStream())
{
//dds.ddsImage[0].Save(ms, ImageFormat.Png);
var bmp = new BitmapImage();
bmp.BeginInit();
bmp.CacheOption = BitmapCacheOption.OnLoad;
bmp.StreamSource = ms;
bmp.EndInit();
ImageOutput.Source = bmp;
}
}
Old calls are commented.
Thank you in advance for any small help.
Subj.
as the title told,when the (uint mask) equal to "0",the loop
while((mask & 1) == 0)
{
mask=mask >> 1;
shift1++;
}
will not stop.
Hello,
I am getting strange result when reading DXT3 files. DXT5 works very well.
Original file https://www.dropbox.com/s/hv6d5ru6dwemsyr/ui_team_logo.dds?dl=0
Original file look https://i.imgur.com/to9Vj9l.png
Lib read file like this https://i.imgur.com/1B2qbJM.png
That is not only for this single file, but for all DXT3 files that I have.
Also, other editors\viewers show such files without any issues.
Do you have an idea if it is possible to fix this?
After stepping through the source, it seems the calculated compressed data size is 0.
The culprit lies here:
DDSImage.cs line 117: uint bps = header.width * header.pixelformat.rgbbitcount / 8;
where rgbbitcount is 0
The header seems to be intact otherwise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.