# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/xfig/hotfix-pngbe.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- xfig-3.2.9a/src/f_readpng.c.vanilla 2026-02-19 19:32:58.131542872 +0100 +++ xfig-3.2.9a/src/f_readpng.c 2026-02-19 19:53:21.320000000 +0100 @@ -202,12 +202,18 @@ /* swap rgb to bgr triples */ /* this is probably not correct for big-endian architectures */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ png_set_bgr(png_ptr); +#endif if (tool_vclass == TrueColor && image_bpp == 4 && !appres.monochrome) { /* write BGRA quadruplets, with fully opaque alpha */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); +#else + png_set_filler(png_ptr, 0xff, PNG_FILLER_BEFORE); +#endif /* one can not use png_set_add_alpha(), or png_set_tRNS_to_alpha(), because those would be contradictory to removing the alpha channel with