Module z_media_identify

Identify files, fetch metadata about an image.

Copyright 2009-2014 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Identify files, fetch metadata about an image

Function Index

extension/1Return the extension for a known mime type (eg.
extension/2
extension/3Return 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/2Caching version of identify/1.
identify/3
identify/4
identify_file/2Fetch information about a file, returns mime, width, height, type, etc.
identify_file/3
identify_file_direct/2Fetch information about a file, returns mime, width, height, type, etc.
is_mime_compressed/1Given a mime type, return whether its file contents is already compressed or not.

Function Details

extension/1

extension(Mime::string() | binary()) -> string()

Return the extension for a known mime type (eg. ".mov").

extension/2

extension(Mime::string() | binary(), PreferExtension::string() | binary() | undefined) -> string()

extension/3

extension(Mime::string() | binary(), PreferExtension::string() | binary() | undefined, Context::#context{}) -> string()

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/1

guess_mime(File::string()) -> string()

Guess the mime type of a file by the extension of its filename.

identify/2

identify(Upload::#upload{} | string(), Context::#context{}) -> {ok, Props::list()} | {error, term()}

Caching version of identify/1. Fetches information about an image, returns width, height, type, etc.

identify/3

identify(File::#upload{} | string(), OriginalFilename::string(), Context::#context{}) -> {ok, Props::list()} | {error, term()}

identify/4

identify(File, MediumFilename, OriginalFilename, Context) -> any()

identify_file/2

identify_file(File::string(), Context::#context{}) -> {ok, Props::list()} | {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/3

identify_file(File::string(), OriginalFilename::string(), Context::#context{}) -> {ok, Props::list()} | {error, term()}

identify_file_direct/2

identify_file_direct(File::string(), OriginalFilename::string()) -> {ok, Props::list()} | {error, term()}

Fetch information about a file, returns mime, width, height, type, etc.

is_mime_compressed/1

is_mime_compressed(X1::string()) -> boolean()

Given a mime type, return whether its file contents is already compressed or not.


Generated by EDoc, Jul 11 2014, 23:32:35.