|
|
Web Resizer - APIAdvanced Integration - Transferring ImagesSending and Saving Images ... This section outlines advanced integration to use Web Resizer as an image editor for photos in online image galleries. For simple integration follow the Quick Start instructions. Sending Images to Web ResizerImages are sent to Web Resizer with the API parameter image_url. The following code will open fred.jpg in webresizer for editing. <script type="text/javascript">
var webresizerAPI = new Object;
webresizerAPI.parameters = {
The examples on this page use Object Notation, but Quick Start parameters may also be used if preferred. Saving Images to Your ServerYou will need to create your own callback routine to save the optimized images to your server. Your callback routine can be as simple or complex as you like depending on your requirements. Pass the URL of your callback routine to Web Resizer using API parameter uplink_url. (sample PHP and ASP callback routines are available on the demo page). ExampleThe following code will open fred.jpg in webresizer for editing with the link 'Add to My Gallery' showing. Once the user has finished editing the image, control is passed to your callback routine 'transfer.php'. Your callback routine will need to perform validations and save the optimized image to your server. <script type="text/javascript">
var webresizerAPI = new Object;
webresizerAPI.parameters = {
GET parametersWeb Resizer makes the following information available to your callback routine as GET parameters appended to the uplink_url.
Your callback routine needs to perform all necessary validations. For example, before saving the image to your servers you can check that the image size meets your requirements by checking the 'filesize' value returned. If the image is not the correct size, your callback routine can simply re-open the image in Web Resizer and display a suitable message to the user. View demos and download sample code here Please note each API key is unique and authenticated for use on your domain only. The API will not work if you attempt to use someone elses API key or cut and paste the demo API key ... you'll need to sign up first! |
||||||||||||||||||||||||||||||||||||||