-
Notifications
You must be signed in to change notification settings - Fork 4
Media
Eric edited this page Jun 15, 2025
·
13 revisions
Previous methods have been deprecated as of version
1.45.0
and removed from the wiki. Check out your console with the dev build for warnings.
The crop method allows you to resize and/or crop a base64 encoded image
OGX.Media.crop(_BASE64_, _CALLBACK_, _WIDTH_, _HEIGHT_, _X_, _Y_);
To resize an image
OGX.Media.crop('ar23ez4a5r...', (__base64) => {...}, 600, 600);
To crop an image to get a square of 100px from position
x
50px andy
50px
OGX.Media.crop('ar23ez4a5r...', (__base64) => {...}, 100, 100, 50, 50);
Convert a media
File
into a useableurl
OGX.Media.read(_FILE_, _CALLBACK_);
Practical example
OGX.Media.read(myFile, (__file, __url) => { ... });
Load an image from URL and return base64 encoded string
OGX.Media.load('/img/image.png', (__base64) => {});
Convert a base64 encoded media to a File object
const file = OGX.Media.toFile('data:image/png;base64,...', 'mypic.png');
- Welcome
- Changelog
- Structure
- Configuration
- Getting started
- CLI
- Poly
- Core
- Templating
- Routing
- Controllers
- Components
- Extra Components
- Helpers
- Styling
- Debugging