title: Updating properties of a Django model on save with processing of submitted ImageFields
body: <p>Basically I'm trying to save a Django model which contains an <code>ImageField</code>, and updates its <code>latitude</code> and <code>longitude</code> FloatFields with values grabbed from the EXIF data contained in the image, if any.</p>
  
  <p>Here's a sample model illustrating the issue:</p>
  
  <pre><code>class GeoImage(models.Model):
      image = models.ImageField(upload_to='/path/to/uploads')
      latitude = models.FloatField(null=True, blank=True)
      longitude = models.FloatField(null=True, blank=True)
  
      def save(self):
          # grab the path of the image of the ImageField
          # parse the EXIF data, fetch latitude and longitude
          self.latitude = fetched_latitude
          self.longitude = fetched_longitude
          return super(GeoImage, self).save()
  </code></pre>
  
  <p>Can you spot the problem? I don't know how to access the image filepath before the model instance is actually saved, and I can't save the record, update some properties then save it back again, because it would create a post_save loop (and same goes theorically with a <code>post_save</code> signal…</p>
  
  <p>Any help much appreciated.</p>
  
  <p><strong>Note:</strong> I don't need help with EXIF data extraction nor parsing, just with the way to update the whole model on save().</p>
  
  <p><strong>Edit:</strong> Okay so you can access the file object and process it further before the record being saved:</p>
  
  <pre><code>class GeoImage(models.Model):
      image = models.ImageField(upload_to='/path/to/uploads')
      latitude = models.FloatField(null=True, blank=True)
      longitude = models.FloatField(null=True, blank=True)
  
      def save(self):
          latitude, longitude = gps_utils.process_exif(self.image.file)
          if latitude: self.latitude = latitude
          if longitude: self.longitude = longitude
          return super(GeoImage, self).save(*args, **kwarg)
  </code></pre>