Updating testing source code for write PNG image.