Media stores information about a media, for now only image and youtube videos are supported.
The image type provides the current fields:
Meta:
Width
Height
Size
ContentType
Length
Exif
: not used yetHash
: not used yetSourceStatus
: SourceUrl processing statusSourceError
: SourceUrl processing result on error
Data:
Reference
: contextual information about the mediaName
: image nameSourceUrl
: can be used to provided an url to retrieve the media
You can retrieve the binary through an api call by adding the ?raw=1
into the query string. The prism handler can
also be used, this entry point will provide crop and resize option.
http://localhost:2508/prism/bcb537ab-b349-4b3d-87e2-e43e17519af7
=> get the original imagehttp://localhost:2508/prism/bcb537ab-b349-4b3d-87e2-e43e17519af7?mr=250
=> resize the media with the provided widthhttp://localhost:2508/prism/bcb537ab-b349-4b3d-87e2-e43e17519af7?mf=200,200
=> crop the media using a 200x200 square from the center of the image.
The image resize and crop only works with: jpg
, png
and jpg
files.
The YouTube type provided the following fields:
Meta (from youtube metadata)
Type
Html
Width
Height
Version
Title
ProviderName
AuthorName
AuthorUrl
ProviderUrl
ThumbnailUrl
ThumbnailWidth
ThumbnailHeight
Data:
Vid
: The video idStatus
: processing statusError
: processing error
The downloaded thumbnail will become a media type.
[media]
[media.image]
allowed_widths = [100, 200]
max_width = 300
allowed_widths
: slice of valid widths, if empty all widths are possiblemax_width
: max allows width, if empty andallowed_width
is empty then all widths are possible.
To avoid any issues, those settings must be set and a cache layer configured