pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
304 stars 53 forks source link

Official and localized models #20

Open powturns opened 5 years ago

powturns commented 5 years ago

When an image file contains an alias of the camera model, rather than the official camera model, there is no way to relate back to the official model.

For example, with a T3i, I would expect to get back the official model of Canon EOS 600D (from data/cameras/canon/600d.toml) when calling camera.model. However, instead I get back the localized model Canon EOS REBEL T3i.

This can introduce difficulties when you want to branch behaviour based on the camera model as each localized case must be handled, rather than a single official model case.

Proposal would be to modify RawImage.{model, clean_model} to return the official model name, and add two new properties RawImage.{localized_model, clean_localized_model} that return the localized model name.

pedrocr commented 5 years ago

I'd take a PR but to do the opposite. Keep what's already there the same and add a canonical_make and canonical_model. I think that's how I did it in rawspeed for the same reasons. For all user-visible purposes you want the actual name of the camera, that's what the user knows it by. It's only for software purposes that you want a single canonical name as you don't care about Canon's (and a few others) crazy marketing setups.