rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
627 stars 134 forks source link

fixed panics on nill tags or something like that #22

Closed alimoeeny closed 10 years ago

alimoeeny commented 10 years ago

Hi @rwcarlsen, I am not sure if what I did was the best way to deal with the problem, but I was getting these panics, which was caused by nill tags. And I thought I'd rather ignore those tags than to panic.

rwcarlsen commented 10 years ago

the exif.Exif.Get method returns an error along with the tag. If the error is non-nil, then the returned tag is nil. My first guess would be that you aren't checking/handling an error from this call. I'd rather not have the nil checks, because they let potential problems in user code slide by quietly.