Project

General

Profile

Bug #900

deprecated png members in gl_png.c

Added by arclore about 12 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
2010-04-22
% Done:

100%


Description

The PNG_Load() function accesses members of png_info directly (png_info->bit_depth etc.). The libpng guys would rather people not do this. These members are marked as deprecated in the current version, and have already been privatized in the dev version.
http://libpng.sourceforge.net/index.html

I've made an edited version that uses the appropriate png_gets. What do you think?

Summary:
declare additional variables
png_uint_32 twidth, theight, retpal;
int bit_depth, color_type, num_palette;
png_byte channels;
png_colorp palette;
call png_get*
png_get_IHDR(png_ptr, png_info, &twidth, &theight, &bit_depth,
&color_type, NULL, NULL, NULL);

channels    = png_get_channels(png_ptr, png_info);
retpal = png_get_PLTE(png_ptr, png_info, &palette,
&num_palette);
replace:
png_info->width with 'twidth'
png_info->height with 'theight'
all other png_info->* with * (ie png_info->bit_depth with bit_depth)

Labels: OpenGL Renderer

History

#2 Updated by skyjake about 12 years ago

Fixed in 1.9.7.

Also available in: Atom PDF