Module z_media_identify

Identify files, fetch metadata about an image.

Copyright © 2009-2012 Marc Worrell Date: 2009-03-02

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.
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_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")

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_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, Dec 10 2012, 20:44:34.