Bug#731486: gimp-dds: Unable to save multiple layers as mipmaps

2016-11-22 Thread Tony Houghton
This should fix it.

Upstream appears to be dead, but hopefully this plugin will continue to
work for the foreseeable future. There are a couple of github repos that
were exported from Google Code, but they look inactive too.
Description: Fix size chain for non-square mipmaps
Author: Tony Houghton 
Forwarded: No
Last-Update: 2016-11-20
Index: gimp-dds-3.0.1/mipmap.c
===
--- gimp-dds-3.0.1.orig/mipmap.c
+++ gimp-dds-3.0.1/mipmap.c
@@ -143,11 +143,11 @@ unsigned int get_volume_mipmapped_size(i
 int get_next_mipmap_dimensions(int *next_w, int *next_h,
int  curr_w, int  curr_h)
 {
-   if(curr_w == 1 || curr_h == 1)
+   if(curr_w == 1 && curr_h == 1)
   return(0);
 
-   if(next_w) *next_w = curr_w >> 1;
-   if(next_h) *next_h = curr_h >> 1;
+   if(next_w) *next_w = curr_w == 1 ? 1 : curr_w >> 1;
+   if(next_h) *next_h = curr_h == 1 ? 1 : curr_h >> 1;
 
return(1);
 }


Bug#731486: gimp-dds: Unable to save multiple layers as mipmaps

2013-12-05 Thread Tony Houghton
Package: gimp-dds
Version: 2.2.1-1
Severity: important

I'm trying to create a DDS texture that changes appearance with viewing
distance, but gimp won't let me save multiple layers as mipmaps. In the
Save as DDS dialog the Save: Selected layer field is greyed out so I
can only save one layer, and the options for Mipmaps: are No mipmaps
or Generate mipmaps; Use existing mipmaps is greyed out. I created
the extra layers by first saving the image as a DDS with Generate
mipmaps, so the configuration of the layers should be compatible, but
even if I don't make any edits at all, I can't export these layers as
mipmaps. The overall image size is 512x256, the top layer is called
main surface, and below it are layers mipmap 1 through mipmap 9,
each with a width and height half that of the layer above.

-- System Information:
Debian Release: jessie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gimp-dds depends on:
ii  libc6 2.17-96
ii  libgimp2.02.8.6-1
ii  libglib2.0-0  2.36.4-1
ii  libgtk2.0-0   2.24.22-1

gimp-dds recommends no packages.

gimp-dds suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#731486: gimp-dds: Unable to save multiple layers as mipmaps

2013-12-05 Thread Tony Houghton
I've worked out that the problem stems from my image being non-square.
When gimp created mipmaps it made levels/layers from 256x128 through 2x1
but the final layer was 1x1. I looked at the source and found that when
exporting existing layers as mipmaps it validates the layers by looking
for a chain with each successive layer being half the size of the
previous, using a bitshift for a fast divide by 2, so when looking for
the next layer after 2x1 it would try to find 1x0 and fail.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org