add comment to replace mime type detector
This commit is contained in:
@@ -211,5 +211,9 @@ func detectMimeType(file io.ReadSeeker) (string, error) {
|
||||
if readErr != nil && readErr != io.EOF && readErr != io.ErrUnexpectedEOF {
|
||||
return "", fmt.Errorf("read file header: %w", readErr)
|
||||
}
|
||||
|
||||
// will replace later, http.DetectContentType doesnt detect as much as i want it to
|
||||
// github.com/google/magika - ML based, working on bindings for go? requires cgo & onnxruntime
|
||||
// github.com/gabriel-vasile/mimetype - native go, similar amount of labels to magika
|
||||
return http.DetectContentType(buffer[:n]), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user