Skip to content

file types are incorrectly determined from mime types #183

@s-ol

Description

@s-ol

isImage, isVideo... checks are not strict enough (line 1114):

  isVideo: !!~data.type.toLowerCase().indexOf('video')
  isAudio: !!~data.type.toLowerCase().indexOf('audio')
  isImage: !!~data.type.toLowerCase().indexOf('image')
  isText:  !!~data.type.toLowerCase().indexOf('text')
  isJSON:  !!~data.type.toLowerCase().indexOf('json')
  isPDF:   !!~data.type.toLowerCase().indexOf('pdf')

for example the file type for .iso images is application/iso-image, application/x-iso-image or application/x-iso9660-image, all of which trigger isImage (wrongly).
At least for image, it should be checked with something along the lines of data.type.toLowerCase().startsWith("image/") IMO.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions