title: return statement
body: <p>after_photo_post_process  :post_process_photo </p>
  
  <pre><code> def post_process_photo
    img = EXIFR::JPEG.new(photo.queued_for_write[:original].path)  # error on this line
    return unless img
  
    self.width = img.width
    self.height = img.height
    self.model = img.model
  end
  </code></pre>
  
  <p>I am using a ruby gem called EXIFR that extracts the EXIF data from JPEG files.  The EXIF data is simply technical data about the picture.  So my code works fine when I upload a JPEG, however any other image type causes it to break. </p>
  
  <p>EXIFR::MalformedJPEG in ImagesController#create</p>
  
  <p>no start of image marker found</p>
  
  <p>I assumed that the return statement would allow this to work if nothing gets assigned to the img variable, but that looks like it is not the case.</p>