def _create_image_file(self, name, description, creator, contribution,
                           the_file):
        from geokey.contributions.models import ImageFile

        filename, extension = os.path.splitext(the_file.name)
        filename = self._normalise_filename(filename)
        the_file.name = filename[:FILE_NAME_TRUNC] + extension

        return ImageFile.objects.create(
            name=name,
            description=description,
            creator=creator,
            contribution=contribution,
            image=the_file
        )
Creates an ImageFile and returns the instance.
dataset/ETHPy150Open ExCiteS/geokey/geokey/contributions/managers.py/MediaFileManager._create_image_file