2012-05-08 15 views
6
png_read_info (png_ptr, info_ptr); 
{ 
    png_byte color_type = info_ptr->color_type; 
    png_byte bit_depth = info_ptr->bit_depth; 
    ... 

Para 2 últimas líneas consigoLibPNG 1.5.10 error: eliminación de referencias puntero al tipo incompleto

error: dereferencing pointer to incomplete type

¿Qué ocurre? En libpng 1.4 esto siempre estuvo bien.

+1

Esto significa que no haya incluido las cabeceras apropiadas. – Shahbaz

+1

@Shahbaz 'png.h' están incluidos. '-I/usr/include/libpng15' existe. – askovpen

Respuesta

17

La estructura png_info fue retirado de la png.h en 1.5.0 y ahora se debe utilizar este puntero con los png_get_* y png_set_* funciones.

como se especifica en libpng manual:

The png_info structure is designed to provide information about the PNG file. At one time, the fields of png_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result a set of interface functions for png_info (the png_get_*() and png_set_*() functions) was developed, and direct access to the png_info fields was deprecated..

Por ejemplo:

png_uint_32 height; 
height = png_get_image_height(png_ptr, info_ptr); 
+0

no existe funciones 'png_get_width',' png_get_height'. cómo obtener 'info_ptr-> height',' info_ptr-> width'? – askovpen

+0

tiene funciones coincidentes, ver edición – MByD

Cuestiones relacionadas