@@ -118,13 +118,13 @@ static bool ReadHeightmapPNG(char *filen
return false;
}
png_init_io(png_ptr, fp);
/* Allocate memory and read image, without alpha or 16-bit samples
* (result is either 8-bit indexed/grayscale or 24-bit RGB) */
png_set_packing(png_ptr);
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_PACKING | PNG_TRANSFORM_STRIP_ALPHA | PNG_TRANSFORM_STRIP_16, NULL);
/* Maps of wrong color-depth are not used.
* (this should have been taken care of by stripping alpha and 16-bit samples on load) */
if ((info_ptr->channels != 1) && (info_ptr->channels != 3) && (info_ptr->bit_depth != 8)) {