resolve source type from filename