def _get_png_size(version, scale, quiet_zone=4):
    """See: QRCode.get_png_size

    This function was abstracted away from QRCode to allow for the output of
    QR codes during the build process, i.e. for debugging. It works
    just the same except you must specify the code's version. This is needed
    to calculate the PNG's size.
    """
    #Formula: scale times number of modules plus the border on each side
    return (int(scale) * tables.version_size[version]) + (2 * quiet_zone * int(scale))