def METHOD_NAME(cls, path):
    """Reads the header of `path` and creates a new image instance
    or None.
    """
    from gi.repository import GdkPixbuf, GLib
    pb = []
    # Feed data to PixbufLoader until it emits area-prepared,
    # get the partially filled pixbuf and extract the needed
    # information.
    def area_prepared(loader):
        pb.append(loader.get_pixbuf())
    loader = GdkPixbuf.PixbufLoader()
    loader.connect("area-prepared", area_prepared)
    try:
        with open(path, "rb") as h:
            while not pb:
                data = h.read(1024)
                if data:
                    loader.write(data)
                else:
                    break
    except (EnvironmentError, GLib.GError):
        return
    finally:
        try:
            loader.close()
        except GLib.GError:
            pass
    if not pb:
        return
    pb = pb[0]
    width = pb.get_width()
    height = pb.get_height()
    color_depth = pb.get_bits_per_sample()
    format_ = loader.get_format()
    mime_types = format_.get_mime_types()
    mime_type = mime_types and mime_types[0] or ""
    try:
        return cls(open(path, "rb"), mime_type, width, height, color_depth)
    except EnvironmentError:
        return