Storage.Analyzer (PhoenixContribStorage v0.1.0)

View Source

Analyzes uploaded files to extract metadata.

This module provides functionality to analyze uploaded files and extract useful metadata like image dimensions, video duration, document properties, etc.

Summary

Functions

Analyzes a blob and returns metadata.

Functions

analyze(blob)

Analyzes a blob and returns metadata.

Examples

{:ok, metadata} = Storage.Analyzer.analyze(blob)

# For images:
%{width: 1920, height: 1080, format: "JPEG"}

# For videos:
%{width: 1920, height: 1080, duration: 120.5, format: "MP4"}

analyze_data(data, content_type, filename \\ nil)

Analyzes file data directly.