set fh [openJFIF $file]
set r [catch {getExifFromChannel $fh $type} err]
close $fh
if {$err != ""} {
# If err is empty, the file is closed already
}
return -code $r $err