PXN8 stores all edited images in the ‘cache’ subfolder.
If you installed PXN8 at /var/www/htdocs/pixenate then all of the working images used by PXN8 will be stored in the /var/www/htdocs/pixenate/cache/ directory.
The first thing you will want to do when trying out PXN8 on your own webserver is remove the ‘save to flickr’ button and replace it with a link that saves the image to your own server-side gallery.
PXN8.replaceOnSave = true;
This will ensure that the editor doesn’t try to use a previously cached version of the image (with the same URL).
First create a save-to-gallery cgi script (or servlet) this servlet should accept a number of params one of which should be called ‘changed_image’ (or something similar). You will no doubt want to include additional parameter such as user-id and the original image id or path.
You should add the following form to your editor page…
<form method=”POST” action=”mySaveToGallery.php” onsubmit=”addPXN8ImageToForm(this); return true;”>
[… Any additional CGI parameters used by your own mySaveToGallery.php script should go here ….]
<input id=”changed_image” type=”hidden” name=”changed_image” value=””>
<input type=”submit” value=”Save to Gallery”>
Remember that the value passed in via the
changed_image parameter is a relative path to the final edited image. This path is relative to where PXN8 was installed.
For example: If your webroot directory is /var/www/html/ and you installed pxn8 in /var/www/html/pixenate/ and PXN8.getUncompressedImage returns cache/fe9dworking.jpg then the changed image will be located at the following filepath… /var/www/html/pixenate/cache/fe9dworking.jpg.
Your save-to-gallery CGI script (it’s called mySaveToGallery.php in the sample code above – your own script will obviously be a different name) should either
copy the file to the original image location (if the original image is stored on the filesystem) or update your gallery database (if the image is stored as a BLOB).