Media Server
Introduction
The "media" within the ComUnity Platform's Media Services alludes to the diverse range of content types that the platform can handle, enriching the architecture of digital solutions. The Media Services component of the ComUnity Platform offers a robust layer that efficiently processes requests for every content type it supports. This encompasses two main categories: structured and unstructured data.
Structured Data Handling
Structured data transactions leverage the OData protocol, presenting a dual interface comprising an API for data manipulation and a URL-based query domain-specific language (DSL) for information retrieval. This approach ensures:
Data Parsing: Interprets OData requests to determine the appropriate data entities, supporting authorisation and adherence to data governance policies.
Value-Added Processing: Prior to data relay to the business logic layer, the system performs essential processing for optimisation.
Error Handling: Enhances the developer experience by appending diagnostic information to errors for quicker resolution.
Unstructured Data Management
Unstructured data, particularly a wide array of file types, is handled with robust capabilities:
Azure Blob Storage Integration: Seamlessly uploads and downloads large files (up to 270 GB), featuring functionalities such as de-duplication, download resumption, and cache management.
HTTP Feature Utilisation: Employs partial GET requests, enabling browsers to manage video playback efficiently when accessing large video files hosted on the platform.
Specialised Media Processing
The platform excels in media adaptation and optimisation through:
Image Transformation Pipeline: Utilises a declarative approach for dynamic image processing, which adapts content according to device capabilities to optimise bandwidth and processing requirements.
Caching Mechanism: Improves performance by caching image transformations, minimising CPU usage on subsequent requests.
Iconography Support
Delivering a comprehensive icon set handling, the server:
SVG API Utilisation: Offers access to standard icon repositories, including Font Awesome, Noun Project, and Material Design, complete with on-the-fly rasterisation connected to the image transformation pipeline for efficient icon generation.
By default the ComUnity Developer Toolkit Media Server supports anonymous public read access to storage resources, to increase the security of your applications you may opt to use the managed media server as it only allows permission based and time-bound access to storage resources.
Managing file uploads
SHA File Naming
All files uploaded to the media follow a SHA’s standard file naming convention:
Although use of the SHA File Naming convection prevents duplicate file uploads, its main disadvantage is that uploading an existing file/s are overwritten.
Image file types
Other file types
The Filenames Data Service maintains a mapping of the original file name (or friendly name) to the SHA name.
Upload a single file
Retrieve files
The format of the URL used to retrieve storage resources from a public Media server:
Notes:
Base URL
: this specifies the base url of your project, during development itshttps://toolkitv3.comunity.me
u
: this segment of the URL denotes the Media Server, it is required.args
represent various arguments or parameters which are used to define your search.
Argument | Type | URL Definition |
---|---|---|
d | Direct |
|
f | Friendly |
|
icon | Icon |
|
g |
|
Image manipulation
When fetching images from the Media Server you can append optional arguments to the URL string which allow you to manipulate your images. These modifiers used to manipulate images are derived from Graphics Magick.
The table below describes the image modifiers supported in the Media Server:
The descriptions in the table below were generated using Chat GPT.
Modifier | Name | Description |
---|---|---|
| Auto orient | This modifier is used to automatically adjust the orientation of an image based on its embedded EXIF data. When a photo is taken, the camera records its orientation in the image's metadata. However, some image editors or viewers may not properly handle this information, causing the image to appear rotated incorrectly. The |
| Blur | This modifier applies a Gaussian blur to the image, which can be used to reduce noise or soften details. The
|
| Border | This modifier adds a border of a specified width and height around the image, with a specified color. The |
| Charcoal | The |
| Colorize | This modifier applies a colour tint to the image, changing the colour balance of the image by blending the original colours with the specified tint. The |
| Contrast | This modifier modifier adjusts the contrast of the image by multiplying the pixel values by a specified factor. The |
| Crop | The |
| Draw Text | This modifier adds text to the image at a specified position. The The |
| Enhance | The
|
| Equalize | The The |
| Flatten | The When multiple layers are present in an image, each layer can contain different visual elements, such as text, graphics, or effects. The It should be noted that applying the |
| Flip Vertically | The When applied, the It is important to note that the |
| Flip Horizontally | The When applied, the It is important to note that the |
| Normalise | The When applied, the The |
| Oil painting | The When applied, the It is important to note that the |
| Resize | m – maintain aspect ratio but width and height are minimum ! – exact size p – size in percentage a – maximum area in pixels of an image g – change dimensions only if width or height exceeds s – resizes only if both dimension are less |
| Rotate | The When applied, the The It is important to note that rotating an image can result in loss of quality or detail, particularly if the rotation angle is large. It is therefore recommended to use the |
| Sepia | The When applied, the |
| Thumbnail | The |
| Type | <<type>> - Bilevel Grayscale (default) Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize |
Option | Details |
---|---|
colour | Named colour, e.g. red 0xRGB, hex numbers 0xRRGGBB, 8 bits each 0xRRGGBBAA, 8 bits each |
gravity | NorthWest, North, NorthEast, West, Center, East, SouthWest, South, or SouthEast |
options | m – maintain aspect ratio but width and height are minimum ! – exact size p – size in percentage a – maximum area in pixels of an image g – change dimensions only if width or height exceeds s – resizes only if both dimension are less |
type | Bilevel Grayscale (default) Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize |