Commit 84ec7a80 authored by Nick Lamb /GIMP's avatar Nick Lamb /GIMP
Browse files

Added RGB and Gray tRNS support for Steven Grady

parent e475183f
2000-05-09 Nick Lamb <njl195@zepler.org.uk>
* plug-ins/common/png.c: tRNS expansion using transforms for
the RGB and Grayscale cases, for Steven Grady
2000-05-08 Michael Natterer <mitch@gimp.org>
 
* app/errors.c (gimp_fatal_error): oops, forgot a debugging
......
......@@ -60,7 +60,7 @@
* Constants...
*/
#define PLUG_IN_VERSION "1.3.1 - 25 April 2000"
#define PLUG_IN_VERSION "1.3.2 - 9 May 2000"
#define SCALE_WIDTH 125
#define DEFAULT_GAMMA 2.20
......@@ -429,6 +429,10 @@ load_image (gchar *filename) /* I - File to load */
* Latest attempt, this should be my best yet :)
*/
if (info->bit_depth == 16) {
png_set_strip_16(pp);
}
if (info->color_type == PNG_COLOR_TYPE_GRAY && info->bit_depth < 8) {
png_set_expand(pp);
}
......@@ -437,8 +441,13 @@ load_image (gchar *filename) /* I - File to load */
png_set_packing(pp);
}
if (info->bit_depth == 16) {
png_set_strip_16(pp);
/*
* Expand G+tRNS to GA, RGB+tRNS to RGBA
*/
if (info->color_type != PNG_COLOR_TYPE_PALETTE &&
(info->valid & PNG_INFO_tRNS)) {
png_set_expand(pp);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment