Git Product home page Git Product logo

mime_type's Issues

Incorrect mime type

Trying to record/pick videos using flutte but when I do

lookupMimeType(file.path, headerBytes: [0xFF, 0xD8]).split('/');

it return image, jpeg but its an mp4 video, what could be the issue or what am I doing wrong?

Missing mime type for json

The mime type for the json extension is missing, how about adding it? It is:

application/json (See RFC4627)

File type "image/bmp" is not supported propertly.

file --mime-type -b /Users/me/Downloads/74ab8f4f5e2e74805eb3fe1eb717dfe2

On Mac shows "image/bmp"

On Flutter it returns "image/jpg"

We need to know if it's "image/bmp" for server-side processing reasons.

User generated file below (very old test photo of me)

74ab8f4f5e2e74805eb3fe1eb717dfe2

Wrong Extension from MimeType

There are multiple extensions for the same MimeType.
For e.g: "video/mp4".

See

const Map<String, String> _mimeMap = <String, String>{

In this map, the available extensions for video/mp4 mime type are:

  • hevc
  • mp4
  • mp4v
  • mpg4

If the video is MP4 and the mimeType is video/mp4. Then using this function

extensionFromMime

will return you the extension "hevc". Because this is the first entry in the map.

There should be a method to match the type

Once we get the mimeType, in uses other than web requests, it would be useful to have a method to which we can match the type to a group, for instance: isType(VIDEO, mime(filePath))

Cannot import library

I get this error on the following import

import 'package:mime_type/mime_type.dart';
>Error: Could not resolve the package 'mime_type' in 'package:mime_type/mime_type.dart'.

I added the package to my dependencies as follows

pubspec.yaml:

dependencies:
  mime: ^0.9.1

I did run flutter pub get before running my app

Support null safety

This is a request to add support for null safety to package:mime_type.
We depend on your awesome package, so would be great to have null safety enabled.

The Dart/Flutter team already encourages publishing the migrated packages: See this blog post.

See the migration guide for details about enabling null safety.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.