format = self.field.format
if not format:
// Get the real (not suggested) extension.
extension = os.path.splitext(self.name)[1].lower()
// Try to guess the format from the extension.
format = Image.EXTENSION.get(extension)
format = format or img.format or "JPEG"
After Change
fp.seek(0)
fp = StringIO(fp.read())
img, content = self._process_content(self.name, fp)
self._file = self.storage.save(self.name, content)
else:
// TODO: Should we error here or something if the imagefield doesn"t exist?