Copyright © 2009-2014 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
filename_extension() = binary()
media_info() = map()
mime_type() = binary()
optional_filename() = undefined | file:filename_all()
extension/1 | Return the extension for a known mime type (eg. |
extension/2 | |
extension/3 | Return the extension for a known mime type (eg. |
guess_mime/1 | Guess the mime type of a file by the extension of its filename. |
identify/2 | Caching version of identify/3. |
identify/3 | |
identify/4 | |
identify_file/2 | Fetch information about a file, returns mime, width, height, type, etc. |
identify_file/3 | |
identify_file_direct/2 | Fetch information about a file, returns mime, width, height, type, etc. |
is_mime_compressed/1 | Given a mime type, return whether its file contents is already compressed or not. |
is_mime_vector/1 |
extension(Mime::string() | binary()) -> filename_extension()
Return the extension for a known mime type (eg. ".mov").
extension(Mime::string() | binary(), PreferExtension::string() | binary() | undefined) -> filename_extension()
extension(Mime::string() | binary(), PreferExtension::string() | binary() | undefined, Context::z:context()) -> filename_extension()
Return the extension for a known mime type (eg. ".mov"). When multiple extensions are found for the given mime type, returns the one that is given as the preferred extension. Otherwise, it returns the first extension.
guess_mime(File::file:filename_all()) -> mime_type()
Guess the mime type of a file by the extension of its filename.
identify(Upload::#upload{} | file:filename_all(), Context::z:context()) -> {ok, media_info()} | {error, term()}
Caching version of identify/3. Fetches information about an image, returns width, height, type, etc.
identify(File::#upload{} | file:filename_all(), OriginalFilename::optional_filename(), Context::z:context()) -> {ok, media_info()} | {error, term()}
identify(File, MediumFilename, OriginalFilename, Context) -> any()
identify_file(File::file:filename_all(), Context::z:context()) -> {ok, media_info()} | {error, term()}
Fetch information about a file, returns mime, width, height, type, etc. First checks if a module has a specific identification methods.
identify_file(File::file:filename_all(), OriginalFilename::optional_filename(), Context::z:context()) -> {ok, media_info()} | {error, term()}
identify_file_direct(File::file:filename_all(), OriginalFilename::optional_filename()) -> {ok, media_info()} | {error, term()}
Fetch information about a file, returns mime, width, height, type, etc.
is_mime_compressed(X1::binary()) -> boolean()
Given a mime type, return whether its file contents is already compressed or not.
is_mime_vector(Mime::string() | mime_type()) -> boolean()
Generated by EDoc