The source project of this merge request has been removed.
Fixed bug #3048 Indexed image BG always 0 when exporting PNG
Indexed images always had a BG index of 0 because the index of the color currently set as the BG was not known. This fix iterates through the colormap assigned to the png and finds the matching color, then sets the BG index to that index.
Fixed code style issues and applied patch to master branch.