title: Django Exif Data: 'IFDRational' object is not subscriptable
body: <p>I got an issue with the code:
  'IFDRational' object is not subscriptable</p>
  <p>Here is the trace:</p>
  <pre><code>lat = get_decimal_from_dms(geotags['GPSLatitude'], geotags['GPSLatitudeRef'])
  degrees = dms[0][0] / dms[0][1] 
  </code></pre>
  <p>the is issue is:
  Variable    Value
  dms
  (45.0, 46.0, 34.29)
  ref
  'N'</p>
  <pre><code>{'GPSAltitude': 22.90324416619237,
   'GPSAltitudeRef': b'\x00',
   'GPSDateStamp': '2020:10:17',
   'GPSDestBearing': 18.1919587128,
   'GPSDestBearingRef': 'M',
   'GPSHPositioningError': 65.0,
   'GPSImgDirection': 108.199192887128,
   'GPSImgDirectionRef': 'M',
   'GPSLatitude': (12.0, 26.0, 14.09),
   'GPSLatitudeRef': 'N',
   'GPSLongitude': (1.0, 47.0, 39.38),
   'GPSLongitudeRef': 'E',
   'GPSSpeed': 0.0,
   'GPSSpeedRef': 'K',
   'GPSTimeStamp': (12.0, 58.0, 42.0)}
  </code></pre>
  <p>That what I get from an image for instance. I think the code assimilate GPSLatitudeRef to degrees = dms[0][0] / dms[0][1]. The thing is GPSLatitudeRef is a letter none a number.</p>
  <pre><code>def get_geotagging(exifgps):
      
          geotagging = {}
          for (idx, tag) in TAGS.items():
              if tag == 'GPSInfo':
                  if idx not in exifgps:
                      raise ValueError(&quot;No EXIF geotagging found&quot;)
      
                  for (key, val) in GPSTAGS.items():
                      if key in exifgps[idx]:
                          geotagging[val] = exifgps[idx][key]
      
          return geotagging
          
      def get_decimal_from_dms(dms, ref):
  
          degrees = dms[0][0] / dms[0][1]
          minutes = dms[1][0] / dms[1][1] / 60.0
          seconds = dms[2][0] / dms[2][1] / 3600.0
      
          if ref in ['S', 'W']:
              degrees = -degrees
              minutes = -minutes
              seconds = -seconds
      
          return round(degrees + minutes + seconds, 5)
          
      def get_lat_coordinates(geotags):
              lat = get_decimal_from_dms(geotags['GPSLatitude'], geotags['GPSLatitudeRef'])
              return lat
              
      def get_lon_coordinates(geotags):
              lon = get_decimal_from_dms(geotags['GPSLongitude'], geotags['GPSLongitudeRef'])
              return lon
  
  try:
              exifgps = img.getexif()
              geotags = get_geotagging(exifgps)
              self.gpsinfo = geotags
          except Exception as e:
                  pass
          
          #try:
          exifgps = img.getexif()
          geotags = get_geotagging(exifgps)
          self.latitude = get_lat_coordinates(geotags)
          #except Exception as e:
                  #pass
          
          #try:
          exifgps = img.getexif()
          geotags = get_geotagging(exifgps)
          self.longitude = get_lon_coordinates(geotags)
          #except Exception as e:
                  #pass
  </code></pre>