I'm storing the “other” metadata (metadata not automatically captured by Rails/ActiveRecord/ActiveStorage) in the new “other_metadata” company_file field.
I think I’ll keep the raw extraction value for each “metadata of interest” field that we collect, each stored as a key/value pair in the “other_metadata” object.
Additionally, I’ll create a new field with “Formatted” appended to the end of the field name for any field that we want to always try to have consistent data type & format for (e.g. latitude/longitude fields)
Example: latitude/longitude
HEIC, HEIF files
the lat/long values are in the keys GPSLatitude/GPSLongitude and in the “DMS” format (as shown in attached screenshots), but this format isn’t super usable (nor the same data type or format as our project lat/lon data), so I have a method to convert it to decimal degrees and store it in the GPSLatitudeFormatted/GPSLongitudeFormatted fields
…other file types
Maybe other file types also have latitude and longitude fields (maybe they are also called GPSLatitude/GPSLongitude, or maybe something else), possibly as different data types or formats as well…. we can always still depend on the GPSLatitudeFormatted/GPSLongitudeFormatted fields being present in the correct “decimal degrees” format (because we will handle the conversions of whatever latitude/longitude types we come across, adding new methods to the controller to convert them to decimal degrees format)
(Note: it seems that GPSLatitude/GPSLongitude seem to be consistent among file types so far, if they have latitude/longitude data present, but I think it’s a safe idea to keep the same sort of system — never modifying the actual metadata values (storing them as is) + creating a “xFormatted” field as needed for data type consistency/dependability)