png_get_pHYs

Name

png_get_pHYs -- get the physical resolution for given image

Synopsis

#include <png.h>

png_uint_32 png_get_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 * res_x, png_uint_32 * res_y, int * unit_type);

Description

png_get_pHYs() shall return the physical pixel resolution of the image and the unit of resolution. Upon success, *res_x shall contain the horizontal resolution and *res_y shall contain the vertical resolution in pixels per unit. *unit_type will be set to PNG_RESOLUTION_METER if the resolution is expressed in pixels per meter. Otherwise *unit_type will be PNG_RESOLUTION_UNKNOWN.

Return Value

PNG_INFO_pHYs - on success 0 - otherwise.