Commit 81a3370e authored by Jacob Boerema's avatar Jacob Boerema Committed by Jehan

plug-ins: fix #5357 Image marked as compressed, but DDSD_LINEARSIZE is not set.

parent a3a88bf6
Pipeline #199063 passed with stages
in 29 minutes and 59 seconds
......@@ -597,14 +597,28 @@ validate_header (dds_header_t *hdr)
return FALSE;
}
if ((hdr->flags & DDSD_PITCH) == (hdr->flags & DDSD_LINEARSIZE))
if (hdr->pixelfmt.flags & DDPF_FOURCC)
{
//g_message ("Warning: DDSD_PITCH or DDSD_LINEARSIZE is not set.\n");
if (hdr->pixelfmt.flags & DDPF_FOURCC)
hdr->flags |= DDSD_LINEARSIZE;
else
hdr->flags |= DDSD_PITCH;
if (hdr->flags & DDSD_PITCH)
{
g_message ("Warning: DDSD_PITCH is incorrectly set for DDPF_FOURCC!");
hdr->flags &= DDSD_PITCH;
}
if (! (hdr->flags & DDSD_LINEARSIZE))
{
g_message ("Warning: DDSD_LINEARSIZE is incorrectly not set for DDPF_FOURCC!");
hdr->flags |= DDSD_LINEARSIZE;
}
}
else
{
if (! (hdr->flags & DDSD_PITCH))
{
g_message ("Warning: DDSD_PITCH is not set!");
hdr->flags |= DDSD_PITCH;
}
}
/*
if ((hdr->pixelfmt.flags & DDPF_FOURCC) ==
(hdr->pixelfmt.flags & DDPF_RGB))
......@@ -1148,12 +1162,6 @@ load_layer (FILE *fp,
{
guchar *dst;
if (!(hdr->flags & DDSD_LINEARSIZE))
{
g_message ("Image marked as compressed, but DDSD_LINEARSIZE is not set.\n");
return FALSE;
}
dst = g_malloc (width * height * d->gimp_bpp);
memset (dst, 0, width * height * d->gimp_bpp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment