Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a097f6e
)
ecere/gfx/PNGFormat: (#960) Fixed crash on palette PNG
author
Jerome St-Louis
<jerome@ecere.com>
Fri, 30 Aug 2013 07:04:00 +0000
(
03:04
-0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Fri, 30 Aug 2013 07:04:00 +0000
(
03:04
-0400)
- This is a partial fix for #960
- 'channels' still say 1 even though it gets expanded
- even get_row_width multiplies by 1 byte!
ecere/src/gfx/bitmaps/PNGFormat.ec
patch
|
blob
|
history
diff --git
a/ecere/src/gfx/bitmaps/PNGFormat.ec
b/ecere/src/gfx/bitmaps/PNGFormat.ec
index
ee18986
..
a7a4740
100644
(file)
--- a/
ecere/src/gfx/bitmaps/PNGFormat.ec
+++ b/
ecere/src/gfx/bitmaps/PNGFormat.ec
@@
-88,6
+88,11
@@
class PNGFormat : BitmapFormat
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(png_ptr);
numPasses = png_set_interlace_handling(png_ptr);
+ if(color_type == PNG_COLOR_TYPE_PALETTE)
+ {
+ png_set_palette_to_rgb(png_ptr);
+ channels = 4;
+ }
if((result = bitmap.Allocate(null, (uint)width, (uint)height, 0, pixelFormatRGBA, false)))
{