def __init__(self, fullpath):
        self.valid = False
        self.reset()
        self.fullpath = fullpath
        if path.isfile(self.fullpath) and access(self.fullpath, WRITEABLE):
            self.filetype = determinetype(self.fullpath)
            if self.filetype in ["jpeg", "png"]:
                oldfile = QFileInfo(self.fullpath)
                self.shortname = oldfile.fileName()
                self.oldfilesize = oldfile.size()
                self.icon = QIcon(self.fullpath)
                self.valid = True

    #def _determinetype(self):
    #    """ Determine the filetype of the file using imghdr. """
    #    filetype = determinetype(self.fullpath)
    #    if filetype in ["jpeg", "png"]:
    #        self.filetype = filetype
    #    else:
    #        self.filetype = None
    #    return self.filetype
Checks if project page is returned properly.
dataset/ETHPy150Open Kilian/Trimage/src/trimage/trimage.py/Image.__init__--crossover with--dataset/ETHPy150Open mozilla/pontoon/pontoon/base/tests/test_views.py/ProjectTests.test_project_view