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

Tony Houghton h at realh.co.uk
Tue Nov 22 16:26:50 UTC 2016


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20161122/875d04fc/attachment.html>
-------------- next part --------------
Description: Fix size chain for non-square mipmaps
Author: Tony Houghton <h at realh.co.uk>
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);
 }


More information about the Pkg-games-devel mailing list