photocat API

PhotoCat API Introduction

PhotoCat is a fun all-in-one photo editor allowing users to easily edit their photos, enhance portraits, create collages and share their work.

PhotoCat API enables Web developers to integrate PhotoCat into their own site, and it’s completely free to use our API.

Technical Support

Email:photocat@commsource.com

Run the sample code to see results!

First: Environment Configuration

Download this file: crossdomain.xml, then place it into the root directory of the webserver where the image files would be stored. For example, if the server URL is http://www.example.com, then the URL of crossdomain.xml file should be: http://www.example.com/crossdomain.xml.
crossdomain.xml configuration will authorize PhotoCat Flash to send upload image files to your site.

[Note] If testing locally, it will be blocked by flash security sandbox, so please set up a web server to test it in a web environment.

Second: Include JS

<script src="http://source.photocat.com/api/js/photocat.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload=function(){  
  photocat.setUploadURL("http://web.photocat.com/api/sample/image_save_sample.php");
  // This is the URL of the image saving .php page
  
  photocat.loadPhoto("http://source.photocat.com/api/images/04.jpg");
  // This is the URL of the image to be edited
  
  photocat.onInit=function(data){};
  
  photocat.onUploadResponse = function (data)
  {
	//alert("upload response" + data); This will enable debugging.
  }
  
  photocat.embedSWF("altContent",1,"100%","100%");
  /*The 1st parameter is the div container to load the editor, 2nd parameter is editor type, 
  3rd is div container width, 4th is div container height*/
}
</script>

[Note] Parameter of setUploadURL("") is the URL of the .php file for saving images. Download a php file sample here

Click on the image below to open image editor

editor

goTop