diff --git a/deployed/jsn/administrator/components/com_jsn/access.xml b/deployed/jsn/administrator/components/com_jsn/access.xml
new file mode 100644
index 00000000..9f0ea711
--- /dev/null
+++ b/deployed/jsn/administrator/components/com_jsn/access.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deployed/jsn/administrator/components/com_jsn/assets/ImgPicker.php b/deployed/jsn/administrator/components/com_jsn/assets/ImgPicker.php
new file mode 100644
index 00000000..a632f84f
--- /dev/null
+++ b/deployed/jsn/administrator/components/com_jsn/assets/ImgPicker.php
@@ -0,0 +1,906 @@
+ 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
+ 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
+ 3 => 'The uploaded file was only partially uploaded',
+ 4 => 'No file was uploaded',
+ 6 => 'Missing a temporary folder',
+ 7 => 'Failed to write file to disk',
+ 8 => 'A PHP extension stopped the file upload',
+ 'gd' => 'PHP GD library is NOT installed on your web server',
+ 'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
+ 'max_file_size' => 'File is too big',
+ 'min_file_size' => 'File is too small',
+ 'accept_file_types' => 'Filetype not allowed',
+ 'max_width' => 'Image exceeds maximum width of ',
+ 'min_width' => 'Image requires a minimum width of ',
+ 'max_height' => 'Image exceeds maximum height of ',
+ 'min_height' => 'Image requires a minimum height of ',
+ 'upload_failed' => 'Failed to upload the file',
+ 'move_failed' => 'Failed to upload the file',
+ 'invalid_image' => 'Invalid image',
+ 'image_resize' => 'Failed to resize image',
+ 'not_exists' => 'Failed to load the image'
+ );
+
+ /**
+ * Create a new instance.
+ *
+ * @param array $options
+ * @param array $errorMessages
+ * @return void
+ */
+ public function __construct($options = array(), $errorMessages = array())
+ {
+ $this->options = array(
+ // Upload directory path:
+ 'upload_dir' => __DIR__ . '/files/',
+
+ // Upload directory url:
+ 'upload_url' => $this->getFullUrl() . '/files/',
+
+ // Accepted file types:
+ 'accept_file_types' => 'png|jpg|jpeg|gif',
+
+ // Directory mode:
+ 'mkdir_mode' => 0755,
+
+ // File size restrictions (in bytes):
+ 'max_file_size' => null,
+ 'min_file_size' => 1,
+
+ // Image resolution restrictions (in px):
+ 'max_width' => null,
+ 'max_height' => null,
+ 'min_width' => 1,
+ 'min_height' => 1,
+
+ // Auto orient image based on EXIF data:
+ 'auto_orient' => true,
+
+ // Image versions
+ 'versions' => array(
+ //'' => array(
+ //'upload_dir' => '',
+ //'upload_url' => '',
+ // Create square images
+ // 'crop' => true,
+ // 'max_width' => 200,
+ // 'max_height' => 200,
+ //),
+
+ // 'avatar' => array(
+ // 'crop' => true,
+ // 'max_width' => 200,
+ // 'max_height' => 200
+ // ),
+
+ // 'small' => array(
+ // 'crop' => true,
+ // 'max_width' => 100
+ // )
+ )
+ );
+
+ $this->options = $options + $this->options;
+
+ $this->errorMessages = $errorMessages + $this->errorMessages;
+
+ $this->initialize();
+ }
+
+ /**
+ * Initialize upload and crop actions.
+ *
+ * @return void
+ */
+ protected function initialize()
+ {
+ if (!extension_loaded('gd') || !function_exists('gd_info')) {
+ $this->error = $this->getErrorMessage('gd');
+ return false;
+ }
+
+ $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
+
+ if (method_exists($this, $action.'Action')) {
+ return $this->{$action.'Action'}();
+ }
+ }
+
+ /**
+ * Load action.
+ *
+ * @return void
+ */
+ protected function loadAction()
+ {
+ if (!isset($this->options['load'])) {
+ return;
+ }
+
+ $files = call_user_func($this->options['load'], $this);
+
+ if (!$files) {
+ return;
+ }
+
+ if (!is_array($files)) {
+ $files = array($files);
+ $single = true;
+ }
+
+ $images = array();
+
+ foreach ($files as $file) {
+ $image = new stdClass();
+ $image->path = $this->getUploadPath($file);
+
+ if (!file_exists($image->path)) {
+ continue;
+ }
+
+ $image->name = $file;
+ $image->type = $this->getFileExtension($image->name);
+ $image->url = $this->getUploadUrl($image->name);
+
+ list($image->width, $image->height) = @getimagesize($image->path);
+
+ foreach ($this->options['versions'] as $version => $options) {
+ $filename = $this->getVersionFilename($image->name, $version);
+ $filepath = $this->getUploadPath($filename, $version);
+
+ list($width, $height) = @getimagesize($filepath);
+
+ $image->versions[$version] = array(
+ 'url' => $this->getUploadUrl($filename, $version),
+ 'width' => $width,
+ 'height' => $height
+ );
+ }
+
+ unset($image->path);
+
+ if (isset($single)) {
+ $images = $image;
+ } else {
+ $images[] = $image;
+ }
+ }
+
+ $this->generateResponse($images);
+ }
+
+ /**
+ * Preview action.
+ *
+ * @return void
+ */
+ protected function previewAction()
+ {
+ $get=JFactory::getApplication()->input->get->getArray();
+ $filename = basename(@$get['file']);
+ $width = @$get['width'];
+ $rotate = @$get['rotate'];
+
+ $filepath = $this->getUploadPath($filename);
+ $filetype = $this->getFileExtension($filename);
+
+ if (file_exists($filepath)) {
+ list($src_w, $src_h) = @getimagesize($filepath);
+
+ $dst_w = $src_w;
+ $dst_h = $src_h;
+
+ if (is_numeric($width) && $width > 0) {
+ $dst_w = $width;
+ $dst_h = $src_h / $src_w * $width;
+ }
+
+ $dst_path = $this->getUploadPath(md5($filename).'.'.$filetype);
+
+ $this->resizeImage($filepath, $dst_path, 0, 0, $dst_w, $dst_h, $src_w, $src_h);
+
+ if (in_array(abs($rotate), array(90, 180, 270))) {
+ $angle = ($rotate < 0) ? abs($rotate) : 360 - $rotate;
+ $this->rotateImage($dst_path, $angle);
+ }
+ $ext = pathinfo($dst_path, PATHINFO_EXTENSION);
+
+ switch( $ext ) {
+ case "gif": $ctype="image/gif"; break;
+ case "png": $ctype="image/png"; break;
+ case "jpeg":
+ case "jpg": $ctype="image/jpeg"; break;
+ default:
+ }
+
+ header('Content-type: ' . $ctype);
+
+ header('Content-Length: ' . filesize($dst_path));
+ readfile($dst_path);
+ @unlink($dst_path);
+ exit();
+ }
+ }
+
+ /**
+ * Delete action
+ *
+ * @return void
+ */
+ protected function deleteAction()
+ {
+ if (!isset($this->options['delete'])) {
+ return;
+ }
+ $post=JFactory::getApplication()->input->post->getArray();
+ $filename = basename(@$post['file']);
+ $filepath = $this->getUploadPath($filename);
+
+ if (file_exists($filepath) && call_user_func($this->options['delete'], $filename, $this)) {
+ foreach ($this->options['versions'] as $version => $options) {
+ $name = $this->getVersionFilename($filename, $version);
+ $path = $this->getUploadPath($name, $version);
+ @unlink($path);
+ }
+
+ @unlink($filepath);
+ }
+ }
+
+ /**
+ * Upload action.
+ *
+ * @return void
+ */
+ protected function uploadAction()
+ {
+ $jform=JFactory::getApplication()->input->files->getArray();
+ $upload = isset($jform['file']) ? $jform['file'] : null;
+
+ $file = $this->handleFileUpload(
+ @$upload['tmp_name'],
+ @$upload['name'] == 'blob' ? md5(mt_rand()).'.jpg' : @$upload['name'],
+ @$upload['size'],
+ @$upload['error']
+ );
+
+ $this->generateResponse($file);
+ }
+
+ /**
+ * Handle file upload.
+ *
+ * @param string $uploaded_file
+ * @param string $name
+ * @param integer $size
+ * @param integer $error
+ * @return stdClass
+ */
+ protected function handleFileUpload($uploaded_file, $name, $size, $error)
+ {
+ $image = new stdClass();
+ $image->name = $this->getFilename($name);
+ $image->type = $this->getFileExtension($name);
+ $image->size = $this->fixIntOverflow(intval($size));
+ $image->path = $this->getUploadPath($image->name);
+ $image->url = $this->getUploadUrl($image->name);
+ list($image->width, $image->height) = @getimagesize($uploaded_file);
+
+ if (!$this->validate($uploaded_file, $image, $error)) {
+ return $image;
+ }
+
+ $upload_dir = $this->getUploadPath();
+ if (!is_dir($upload_dir)) {
+ mkdir($upload_dir, $this->options['mkdir_mode'], true);
+ }
+
+ //Upload start callback
+ if (isset($this->options['upload_start'])) {
+ call_user_func($this->options['upload_start'], $image, $this);
+ }
+
+ $image->path = $this->getUploadPath($image->name);
+ $image->url = $this->getUploadUrl($image->name);
+
+ if (!move_uploaded_file($uploaded_file, $image->path)) {
+ $image->error = $this->getErrorMessage('move_failed');
+ return $image;
+ }
+
+ // Orient the image
+ if (!empty($this->options['auto_orient'])) {
+ $this->orientImage($image->path);
+ }
+
+ list($image->width, $image->height) = @getimagesize($image->path);
+
+ // Generate image versions
+ $image->versions = $this->generateVersions($image, true);
+
+ // Upload complete callback
+ if (isset($this->options['upload_complete'])) {
+ call_user_func($this->options['upload_complete'], $image, $this);
+ }
+
+ unset($image->path);
+
+ return $image;
+ }
+
+ /**
+ * Crop action.
+ *
+ * @return void
+ */
+ protected function cropAction()
+ {
+ $post=JFactory::getApplication()->input->post->getArray();
+ $filename = basename(@$post['image']);
+ $rotate = @$post['rotate'];
+
+ $image = new stdClass();
+ $image->name = $filename;
+ $image->type = $this->getFileExtension($image->name);
+ $image->path = $this->getUploadPath($image->name);
+ $image->url = $this->getUploadUrl($image->name);
+
+ if (!file_exists($image->path)) {
+ return $this->generateResponse(array('error'=>$this->getErrorMessage('not_exists')));
+ }
+
+ if (!preg_match('/.('.$this->options['accept_file_types'].')+$/i', $image->name)) {
+ return;
+ }
+
+ list($image->width, $image->height) = @getimagesize($image->path);
+
+ @list($src_x, $src_y, $x2, $y2, $src_w, $src_h) = @array_values(@$post['coords']);
+
+ if (isset($this->options['crop_start'])) {
+ call_user_func($this->options['crop_start'], $image, $this);
+ }
+
+ $image->url = $this->getUploadUrl($image->name);
+
+ if (empty($src_w) || empty($src_h)) {
+ $src_w = $image->width;
+ $src_h = $image->height;
+ }
+
+ if (empty($src_x) && empty($src_y)) {
+ $src_x = $src_y = 0;
+ }
+
+ $dst_w = $src_w;
+ $dst_h = $src_h;
+
+ $tmp = clone $image;
+ $tmp->path = $this->getUploadPath(md5($tmp->name).'.'.$tmp->type);
+
+ @copy($image->path, $tmp->path);
+
+ if (in_array(abs($rotate), array(90, 180, 270))) {
+ $angle = ($rotate < 0) ? abs($rotate) : 360 - $rotate;
+ $this->rotateImage($tmp->path, $angle);
+ }
+
+ $this->resizeImage($tmp->path, null, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
+
+ list($tmp->width, $tmp->height) = @getimagesize($tmp->path);
+
+ $image->versions = $this->generateVersions($tmp);
+
+ @unlink($tmp->path);
+
+ if (!isset($this->options['versions'][''])) {
+ @rename($image->path, $this->getUploadPath($image->name));
+ }
+
+ list($image->width, $image->height) = @getimagesize($this->getUploadPath($image->name));
+
+ if ($image->path != $this->getUploadPath($image->name)) {
+ foreach ($this->options['versions'] as $version => $options) {
+ $filename = $this->getVersionFilename(basename($image->path), $version);
+ @unlink($this->getUploadPath($filename, $version));
+ }
+ }
+
+ // Crop complete callback
+ if (isset($this->options['crop_complete'])) {
+ call_user_func($this->options['crop_complete'], $image, $this);
+ }
+
+ unset($image->path);
+
+ // Generate json response
+ $this->generateResponse($image);
+ }
+
+ /**
+ * Generate image versions.
+ *
+ * @param stdClass $image
+ * @param bool $is_upload
+ * @return array
+ */
+ protected function generateVersions($image, $is_upload = false)
+ {
+ $versions = array();
+ foreach ($this->options['versions'] as $version => $options) {
+ $dst_w = $src_w = $image->width;
+ $dst_h = $src_h = $image->height;
+ $src_x = $src_y = 0;
+
+ $max_width = @$options['max_width'];
+ $max_height = @$options['max_height'];
+ $crop = isset($options['crop']) && $options['crop'] === true;
+
+ if ($crop) {
+ $min = min($src_w, $src_h);
+ $src_x = ($src_w - $min)/2;
+ $src_y = ($src_h - $min)/2;
+ $dst_w = $dst_h = $src_w = $src_h = $min;
+ }
+
+ if (!empty($max_width) && $src_w > $max_width || ($src_w < $max_width && $crop)) {
+ $dst_w = $max_width;
+ $dst_h = $src_h / $src_w * $max_width;
+ } else if (!empty($max_height) && $src_h > $max_height || ($src_h < $max_height && $crop)) {
+ $dst_h = $max_height;
+ $dst_w = $src_w / $src_h * $max_height;
+ }
+
+ $filename = $this->getVersionFilename($image->name, $version);
+ $filepath = $this->getUploadPath($filename, $version);
+ $upload_dir = $this->getUploadPath('', $version);
+
+ if (!is_dir($upload_dir)) {
+ mkdir($upload_dir, $this->options['mkdir_mode'], true);
+ }
+
+ if (!$is_upload || ($is_upload && $version != '')) {
+ $success = $this->resizeImage($image->path, $filepath, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
+ }
+
+ if (!empty($success)) {
+ $versions[$version] = array(
+ 'url' => $this->getUploadUrl($filename, $version),
+ 'width' => $dst_w,
+ 'height' => $dst_h
+ );
+ }
+ }
+
+ return $versions;
+ }
+
+ /**
+ * Validate uploaded file.
+ *
+ * @param string $uploaded_file
+ * @param stdClass $name
+ * @param string $error
+ * @return boolean
+ */
+ protected function validate($uploaded_file, $file, $error)
+ {
+ if (!$uploaded_file) {
+ $file->error = $this->getErrorMessage(4);
+ return false;
+ }
+
+ if ($error) {
+ $file->error = $this->getErrorMessage($error);
+ return false;
+ }
+
+ $content_length = $this->fixIntOverflow(intval($_SERVER['CONTENT_LENGTH']));
+ $post_max_size = $this->getConfigBytes(ini_get('post_max_size'));
+
+ if ($post_max_size && $content_length > $post_max_size) {
+ $file->error = $this->getErrorMessage('post_max_size');
+ return false;
+ }
+
+ if ($this->options['max_file_size'] && $file->size > $this->options['max_file_size']) {
+ $file->error = $this->getErrorMessage('max_file_size');
+ return false;
+ }
+
+ if ($this->options['min_file_size'] && $file->size < $this->options['min_file_size']) {
+ $file->error = $this->getErrorMessage('min_file_size');
+ return false;
+ }
+
+ if (!preg_match('/.('.$this->options['accept_file_types'].')+$/i', $file->name)) {
+ $file->error = $this->getErrorMessage('accept_file_types');
+ return false;
+ }
+
+ if (empty($file->width) || empty($file->height)) {
+ $file->error = $this->getErrorMessage('invalid_image');
+ return false;
+ }
+
+ $max_width = @$this->options['max_width'];
+ $max_height = @$this->options['max_height'];
+ $min_width = @$this->options['min_width'];
+ $min_height = @$this->options['min_height'];
+
+ if ($max_width || $max_height || $min_width || $min_height) {
+ if ($max_width && $file->width > $max_width) {
+ $file->error = $this->getErrorMessage('max_width').$max_width.'px';
+ return false;
+ }
+
+ if ($max_height && $file->height > $max_height) {
+ $file->error = $this->getErrorMessage('max_height').$max_height.'px';
+ return false;
+ }
+
+ if ($min_width && $file->width < $min_width) {
+ $file->error = $this->getErrorMessage('min_width').$min_width.'px';
+ return false;
+ }
+
+ if ($min_height && $file->height < $min_height) {
+ $file->error = $this->getErrorMessage('min_height').$min_height.'px';
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Get upload directory path.
+ *
+ * @param string $filename
+ * @param string $version
+ * @return string
+ */
+ public function getUploadPath($filename = '', $version = '')
+ {
+ $upload_dir = $this->options['upload_dir'];
+
+ if ($version != '') {
+ $dir = @$this->options['versions'][$version]['upload_dir'];
+
+ if (!empty($dir)) {
+ $upload_dir = $dir;
+ }
+ }
+
+ return $upload_dir . $filename;
+ }
+
+ /**
+ * Get upload directory url.
+ *
+ * @param string $filename
+ * @param string $version
+ * @return string
+ */
+ public function getUploadUrl($filename = '', $version = '')
+ {
+ $upload_url = $this->options['upload_url'];
+
+ if ($version != '') {
+ $url = @$this->options['versions'][$version]['upload_url'];
+
+ if (!empty($url)) {
+ $upload_url = $url;
+ }
+ }
+
+ return $upload_url . $filename;
+ }
+
+ /**
+ * Get full url.
+ *
+ * @return string
+ */
+ protected function getFullUrl() {
+ $https = !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'on') === 0;
+
+ return
+ ($https ? 'https://' : 'http://').
+ (!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
+ (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
+ ($https && $_SERVER['SERVER_PORT'] === 443 ||
+ $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
+ substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
+ }
+
+ /**
+ * Get file name.
+ *
+ * @param string
+ * @return string
+ */
+ public function getFilename($name)
+ {
+ return $this->getUniqueFilename($name);
+ }
+
+ /**
+ * Get version name.
+ *
+ * @param string
+ * @return string
+ */
+ public function getVersionFilename($filename, $version)
+ {
+ $ext = $this->getFileExtension($filename);
+
+ if ($version == '') {
+ return $filename;
+ }
+
+ return str_replace('.'.$ext, "-$version.$ext", $filename);
+ }
+
+ /**
+ * Get unique file name.
+ *
+ * @param string
+ * @return string
+ */
+ public function getUniqueFilename($name)
+ {
+ while (is_dir($this->getUploadPath($name))) {
+ $name = $this->upcountName($name);
+ }
+
+ while (is_file($this->getUploadPath($name))) {
+ $name = $this->upcountName($name);
+ }
+
+ return $name;
+ }
+
+ /**
+ * Get file extension.
+ *
+ * @param string $filename
+ * @return string
+ */
+ public function getFileExtension($filename)
+ {
+ return pathinfo(strtolower($filename), PATHINFO_EXTENSION);
+ }
+
+ /**
+ * Generate json response.
+ *
+ * @param mixed $response
+ * @return string
+ */
+ public function generateResponse($response)
+ {
+ echo json_encode($response);
+ }
+
+ /**
+ * Get error message.
+ *
+ * @param string $error
+ * @return string
+ */
+ public function getErrorMessage($error)
+ {
+ return isset($this->errorMessages[$error]) ? $this->errorMessages[$error] : $error;
+ }
+
+ /**
+ * Resize image.
+ *
+ * @param string $src_path Source image path
+ * @param string|null $dst_path Destination image path
+ * @param integer $src_x x-coordinate of source point
+ * @param integer $src_y y-coordinate of source point
+ * @param integer $dst_w Destination width
+ * @param integer $dst_h Destination height
+ * @param integer $src_w Source width
+ * @param integer $src_h Source height
+ * @return bool
+ */
+ public function resizeImage($src_path, $dst_path = null, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
+ {
+ $src_x = ceil($src_x);
+ $src_y = ceil($src_y);
+ $dst_w = ceil($dst_w);
+ $dst_h = ceil($dst_h);
+ $src_w = ceil($src_w);
+ $src_h = ceil($src_h);
+
+ $dst_path = ($dst_path) ? $dst_path : $src_path;
+ $dst_image = imagecreatetruecolor($dst_w, $dst_h);
+ $extension = $this->getFileExtension($src_path);
+
+ if (!$dst_image) {
+ return false;
+ }
+
+ switch ($extension) {
+ case 'gif':
+ $src_image = imagecreatefromgif($src_path);
+ break;
+ case 'jpeg':
+ case 'jpg':
+ $src_image = imagecreatefromjpeg($src_path);
+ break;
+ case 'png':
+ imagealphablending($dst_image, false);
+ imagesavealpha($dst_image, true);
+ $src_image = imagecreatefrompng($src_path);
+ @imagealphablending($src_image, true);
+ break;
+ }
+
+ if (isset($src_image) && !$src_image) {
+ return false;
+ }
+
+ if (!imagecopyresampled($dst_image, $src_image, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)) {
+ return false;
+ }
+
+ switch ($extension) {
+ case 'gif':
+ return imagegif($dst_image, $dst_path);
+ break;
+ case 'jpeg':
+ case 'jpg':
+ return imagejpeg($dst_image, $dst_path);
+ break;
+ case 'png':
+ return imagepng($dst_image, $dst_path);
+ break;
+ }
+ }
+
+ /**
+ * Rotate image.
+ *
+ * @param string $src_path
+ * @param integer $angle
+ * @return void
+ */
+ public function rotateImage($src_path, $angle)
+ {
+ $type = $this->getFileExtension($src_path);
+
+ switch ($type) {
+ case 'gif':
+ $source = imagecreatefromgif($src_path);
+ break;
+ case 'jpeg':
+ case 'jpg':
+ $source = imagecreatefromjpeg($src_path);
+ break;
+ case 'png':
+ $source = imagecreatefrompng($src_path);
+ break;
+ }
+
+ $image = imagerotate($source, $angle, 0);
+
+ switch ($type) {
+ case 'gif':
+ imagegif($image, $src_path);
+ break;
+ case 'jpeg':
+ case 'jpg':
+ imagejpeg($image, $src_path);
+ break;
+ case 'png':
+ imagepng($image, $src_path);
+ break;
+ }
+
+ imagedestroy($source);
+ imagedestroy($image);
+ }
+
+ /**
+ * Orient image based on EXIF orientation data.
+ *
+ * @param string $filepath
+ * @return void
+ */
+ protected function orientImage($filepath)
+ {
+ if (!preg_match('/\.(jpe?g)$/i', $filepath)) {
+ return;
+ }
+
+ if (!function_exists('exif_read_data')) {
+ return;
+ }
+
+ $exif = @exif_read_data($filepath);
+
+ if (!empty($exif['Orientation'])) {
+ switch($exif['Orientation']) {
+ case 3: $angle = 180; break;
+ case 6: $angle = -90; break;
+ case 8: $angle = 90; break;
+ }
+
+ if (isset($angle)) {
+ $this->rotateImage($filepath, $angle);
+ }
+ }
+ }
+
+ protected function upcountName($name)
+ {
+ return preg_replace_callback(
+ '/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/',
+ array($this, 'upcountNameCallback'),
+ $name,
+ 1
+ );
+ }
+
+ protected function upcountNameCallback($matches)
+ {
+ $index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
+ $ext = isset($matches[2]) ? $matches[2] : '';
+
+ return ' ('.$index.')'.$ext;
+ }
+
+ protected function getConfigBytes($val)
+ {
+ $val = trim($val);
+ $last = strtolower($val[strlen($val)-1]);
+
+ switch ($last) {
+ case 'g':
+ $val *= 1024;
+ case 'm':
+ $val *= 1024;
+ case 'k':
+ $val *= 1024;
+ }
+
+ return $this->fixIntOverflow($val);
+ }
+
+ protected function fixIntOverflow($size)
+ {
+ if ($size < 0) {
+ $size += 2.0 * (PHP_INT_MAX + 1);
+ }
+
+ return $size;
+ }
+}
diff --git a/deployed/jsn/administrator/components/com_jsn/assets/class.upload.php b/deployed/jsn/administrator/components/com_jsn/assets/class.upload.php
new file mode 100644
index 00000000..efd0bf41
--- /dev/null
+++ b/deployed/jsn/administrator/components/com_jsn/assets/class.upload.php
@@ -0,0 +1,5009 @@
+
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @copyright Colin Verot
+ */
+class upload {
+
+
+ /**
+ * Class version
+ *
+ * @access public
+ * @var string
+ */
+ var $version;
+
+ /**
+ * Uploaded file name
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_name;
+
+ /**
+ * Uploaded file name body (i.e. without extension)
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_name_body;
+
+ /**
+ * Uploaded file name extension
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_name_ext;
+
+ /**
+ * Uploaded file MIME type
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_mime;
+
+ /**
+ * Uploaded file size, in bytes
+ *
+ * @access public
+ * @var double
+ */
+ var $file_src_size;
+
+ /**
+ * Holds eventual PHP error code from FILES
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_error;
+
+ /**
+ * Uloaded file name, including server path
+ *
+ * @access public
+ * @var string
+ */
+ var $file_src_pathname;
+
+ /**
+ * Uloaded file name temporary copy
+ *
+ * @access private
+ * @var string
+ */
+ var $file_src_temp;
+
+ /**
+ * Destination file name
+ *
+ * @access public
+ * @var string
+ */
+ var $file_dst_path;
+
+ /**
+ * Destination file name
+ *
+ * @access public
+ * @var string
+ */
+ var $file_dst_name;
+
+ /**
+ * Destination file name body (i.e. without extension)
+ *
+ * @access public
+ * @var string
+ */
+ var $file_dst_name_body;
+
+ /**
+ * Destination file extension
+ *
+ * @access public
+ * @var string
+ */
+ var $file_dst_name_ext;
+
+ /**
+ * Destination file name, including path
+ *
+ * @access public
+ * @var string
+ */
+ var $file_dst_pathname;
+
+ /**
+ * Source image width
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_src_x;
+
+ /**
+ * Source image height
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_src_y;
+
+ /**
+ * Source image color depth
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_src_bits;
+
+ /**
+ * Number of pixels
+ *
+ * @access public
+ * @var long
+ */
+ var $image_src_pixels;
+
+ /**
+ * Type of image (png, gif, jpg or bmp)
+ *
+ * @access public
+ * @var string
+ */
+ var $image_src_type;
+
+ /**
+ * Destination image width
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_dst_x;
+
+ /**
+ * Destination image height
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_dst_y;
+
+ /**
+ * Destination image type (png, gif, jpg or bmp)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_dst_type;
+
+ /**
+ * Supported image formats
+ *
+ * @access private
+ * @var array
+ */
+ var $image_supported;
+
+ /**
+ * Flag to determine if the source file is an image
+ *
+ * @access public
+ * @var boolean
+ */
+ var $file_is_image;
+
+ /**
+ * Flag set after instanciating the class
+ *
+ * Indicates if the file has been uploaded properly
+ *
+ * @access public
+ * @var bool
+ */
+ var $uploaded;
+
+ /**
+ * Flag stopping PHP upload checks
+ *
+ * Indicates whether we instanciated the class with a filename, in which case
+ * we will not check on the validity of the PHP *upload*
+ *
+ * This flag is automatically set to true when working on a local file
+ *
+ * Warning: for uploads, this flag MUST be set to false for security reason
+ *
+ * @access public
+ * @var bool
+ */
+ var $no_upload_check;
+
+ /**
+ * Flag set after calling a process
+ *
+ * Indicates if the processing, and copy of the resulting file went OK
+ *
+ * @access public
+ * @var bool
+ */
+ var $processed;
+
+ /**
+ * Holds eventual error message in plain english
+ *
+ * @access public
+ * @var string
+ */
+ var $error;
+
+ /**
+ * Holds an HTML formatted log
+ *
+ * @access public
+ * @var string
+ */
+ var $log;
+
+
+ // overiddable processing variables
+
+
+ /**
+ * Set this variable to replace the name body (i.e. without extension)
+ *
+ * @access public
+ * @var string
+ */
+ var $file_new_name_body;
+
+ /**
+ * Set this variable to append a string to the file name body
+ *
+ * @access public
+ * @var string
+ */
+ var $file_name_body_add;
+
+ /**
+ * Set this variable to prepend a string to the file name body
+ *
+ * @access public
+ * @var string
+ */
+ var $file_name_body_pre;
+
+ /**
+ * Set this variable to change the file extension
+ *
+ * @access public
+ * @var string
+ */
+ var $file_new_name_ext;
+
+ /**
+ * Set this variable to format the filename (spaces changed to _)
+ *
+ * @access public
+ * @var boolean
+ */
+ var $file_safe_name;
+
+ /**
+ * Forces an extension if the source file doesn't have one
+ *
+ * If the file is an image, then the correct extension will be added
+ * Otherwise, a .txt extension will be chosen
+ *
+ * @access public
+ * @var boolean
+ */
+ var $file_force_extension;
+
+ /**
+ * Set this variable to false if you don't want to check the MIME against the allowed list
+ *
+ * This variable is set to true by default for security reason
+ *
+ * @access public
+ * @var boolean
+ */
+ var $mime_check;
+
+ /**
+ * Set this variable to false in the init() function if you don't want to check the MIME
+ * with Fileinfo PECL extension. On some systems, Fileinfo is known to be buggy, and you
+ * may want to deactivate it in the class code directly.
+ *
+ * You can also set it with the path of the magic database file.
+ * If set to true, the class will try to read the MAGIC environment variable
+ * and if it is empty, will default to the system's default
+ * If set to an empty string, it will call finfo_open without the path argument
+ *
+ * This variable is set to true by default for security reason
+ *
+ * @access public
+ * @var boolean
+ */
+ var $mime_fileinfo;
+
+ /**
+ * Set this variable to false in the init() function if you don't want to check the MIME
+ * with UNIX file() command
+ *
+ * This variable is set to true by default for security reason
+ *
+ * @access public
+ * @var boolean
+ */
+ var $mime_file;
+
+ /**
+ * Set this variable to false in the init() function if you don't want to check the MIME
+ * with the magic.mime file
+ *
+ * The function mime_content_type() will be deprecated,
+ * and this variable will be set to false in a future release
+ *
+ * This variable is set to true by default for security reason
+ *
+ * @access public
+ * @var boolean
+ */
+ var $mime_magic;
+
+ /**
+ * Set this variable to false in the init() function if you don't want to check the MIME
+ * with getimagesize()
+ *
+ * The class tries to get a MIME type from getimagesize()
+ * If no MIME is returned, it tries to guess the MIME type from the file type
+ *
+ * This variable is set to true by default for security reason
+ *
+ * @access public
+ * @var boolean
+ */
+ var $mime_getimagesize;
+
+ /**
+ * Set this variable to false if you don't want to turn dangerous scripts into simple text files
+ *
+ * @access public
+ * @var boolean
+ */
+ var $no_script;
+
+ /**
+ * Set this variable to true to allow automatic renaming of the file
+ * if the file already exists
+ *
+ * Default value is true
+ *
+ * For instance, on uploading foo.ext,
+ * if foo.ext already exists, upload will be renamed foo_1.ext
+ * and if foo_1.ext already exists, upload will be renamed foo_2.ext
+ *
+ * Note that this option doesn't have any effect if {@link file_overwrite} is true
+ *
+ * @access public
+ * @var bool
+ */
+ var $file_auto_rename;
+
+ /**
+ * Set this variable to true to allow automatic creation of the destination
+ * directory if it is missing (works recursively)
+ *
+ * Default value is true
+ *
+ * @access public
+ * @var bool
+ */
+ var $dir_auto_create;
+
+ /**
+ * Set this variable to true to allow automatic chmod of the destination
+ * directory if it is not writeable
+ *
+ * Default value is true
+ *
+ * @access public
+ * @var bool
+ */
+ var $dir_auto_chmod;
+
+ /**
+ * Set this variable to the default chmod you want the class to use
+ * when creating directories, or attempting to write in a directory
+ *
+ * Default value is 0777 (without quotes)
+ *
+ * @access public
+ * @var bool
+ */
+ var $dir_chmod;
+
+ /**
+ * Set this variable tu true to allow overwriting of an existing file
+ *
+ * Default value is false, so no files will be overwritten
+ *
+ * @access public
+ * @var bool
+ */
+ var $file_overwrite;
+
+ /**
+ * Set this variable to change the maximum size in bytes for an uploaded file
+ *
+ * Default value is the value upload_max_filesize from php.ini
+ *
+ * Value in bytes (integer) or shorthand byte values (string) is allowed.
+ * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
+ *
+ * @access public
+ * @var double
+ */
+ var $file_max_size;
+
+ /**
+ * Set this variable to true to resize the file if it is an image
+ *
+ * You will probably want to set {@link image_x} and {@link image_y}, and maybe one of the ratio variables
+ *
+ * Default value is false (no resizing)
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_resize;
+
+ /**
+ * Set this variable to convert the file if it is an image
+ *
+ * Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'bmp'
+ *
+ * Default value is '' (no conversion)
+ * If {@link resize} is true, {@link convert} will be set to the source file extension
+ *
+ * @access public
+ * @var string
+ */
+ var $image_convert;
+
+ /**
+ * Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels
+ *
+ * Default value is 150
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_x;
+
+ /**
+ * Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels
+ *
+ * Default value is 150
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_y;
+
+ /**
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_ratio;
+
+ /**
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
+ *
+ * The image will be resized as to fill the whole space, and excedent will be cropped
+ *
+ * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
+ * If set as a string, it determines which side of the image is kept while cropping.
+ * By default, the part of the image kept is in the center, i.e. it crops equally on both sides
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var mixed
+ */
+ var $image_ratio_crop;
+
+ /**
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
+ *
+ * The image will be resized to fit entirely in the space, and the rest will be colored.
+ * The default color is white, but can be set with {@link image_default_color}
+ *
+ * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
+ * If set as a string, it determines in which side of the space the image is displayed.
+ * By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var mixed
+ */
+ var $image_ratio_fill;
+
+ /**
+ * Set this variable to a number of pixels so that {@link image_x} and {@link image_y} are the best match possible
+ *
+ * The image will be resized to have approximatively the number of pixels
+ * The aspect ratio wil be conserved
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var mixed
+ */
+ var $image_ratio_pixels;
+
+ /**
+ * Set this variable to calculate {@link image_x} automatically , using {@link image_y} and conserving ratio
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_ratio_x;
+
+ /**
+ * Set this variable to calculate {@link image_y} automatically , using {@link image_x} and conserving ratio
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_ratio_y;
+
+ /**
+ * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
+ * but only if original image is bigger
+ *
+ * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_enlarging}
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_ratio_no_zoom_in;
+
+ /**
+ * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
+ * but only if original image is smaller
+ *
+ * Default value is false
+ *
+ * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_shrinking}
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_ratio_no_zoom_out;
+
+ /**
+ * Cancel resizing if the resized image is bigger than the original image, to prevent enlarging
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_no_enlarging;
+
+ /**
+ * Cancel resizing if the resized image is smaller than the original image, to prevent shrinking
+ *
+ * Default value is false
+ *
+ * @access public
+ * @var bool
+ */
+ var $image_no_shrinking;
+
+ /**
+ * Set this variable to set a maximum image width, above which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_max_width;
+
+ /**
+ * Set this variable to set a maximum image height, above which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_max_height;
+
+ /**
+ * Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var long
+ */
+ var $image_max_pixels;
+
+ /**
+ * Set this variable to set a maximum image aspect ratio, above which the upload will be invalid
+ *
+ * Note that ratio = width / height
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var float
+ */
+ var $image_max_ratio;
+
+ /**
+ * Set this variable to set a minimum image width, below which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_min_width;
+
+ /**
+ * Set this variable to set a minimum image height, below which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_min_height;
+
+ /**
+ * Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var long
+ */
+ var $image_min_pixels;
+
+ /**
+ * Set this variable to set a minimum image aspect ratio, below which the upload will be invalid
+ *
+ * Note that ratio = width / height
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var float
+ */
+ var $image_min_ratio;
+
+ /**
+ * Compression level for PNG images
+ *
+ * Between 1 (fast but large files) and 9 (slow but smaller files)
+ *
+ * Default value is null (Zlib default)
+ *
+ * @access public
+ * @var integer
+ */
+ var $png_compression;
+
+ /**
+ * Quality of JPEG created/converted destination image
+ *
+ * Default value is 85
+ *
+ * @access public
+ * @var integer
+ */
+ var $jpeg_quality;
+
+ /**
+ * Determines the quality of the JPG image to fit a desired file size
+ *
+ * The JPG quality will be set between 1 and 100%
+ * The calculations are approximations.
+ *
+ * Value in bytes (integer) or shorthand byte values (string) is allowed.
+ * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
+ *
+ * Default value is null (no calculations)
+ *
+ * @access public
+ * @var integer
+ */
+ var $jpeg_size;
+
+ /**
+ * Turns the interlace bit on
+ *
+ * This is actually used only for JPEG images, and defaults to false
+ *
+ * @access public
+ * @var boolean
+ */
+ var $image_interlace;
+
+ /**
+ * Flag set to true when the image is transparent
+ *
+ * This is actually used only for transparent GIFs
+ *
+ * @access public
+ * @var boolean
+ */
+ var $image_is_transparent;
+
+ /**
+ * Transparent color in a palette
+ *
+ * This is actually used only for transparent GIFs
+ *
+ * @access public
+ * @var boolean
+ */
+ var $image_transparent_color;
+
+ /**
+ * Background color, used to paint transparent areas with
+ *
+ * If set, it will forcibly remove transparency by painting transparent areas with the color
+ * This setting will fill in all transparent areas in PNG and GIF, as opposed to {@link image_default_color}
+ * which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs
+ * This setting overrides {@link image_default_color}
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var string
+ */
+ var $image_background_color;
+
+ /**
+ * Default color for non alpha-transparent images
+ *
+ * This setting is to be used to define a background color for semi transparent areas
+ * of an alpha transparent when the output format doesn't support alpha transparency
+ * This is useful when, from an alpha transparent PNG image, or an image with alpha transparent features
+ * if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas
+ * If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas
+ *
+ * The default color white
+ *
+ * @access public
+ * @var boolean
+ */
+ var $image_default_color;
+
+ /**
+ * Flag set to true when the image is not true color
+ *
+ * @access public
+ * @var boolean
+ */
+ var $image_is_palette;
+
+ /**
+ * Corrects the image brightness
+ *
+ * Value can range between -127 and 127
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_brightness;
+
+ /**
+ * Corrects the image contrast
+ *
+ * Value can range between -127 and 127
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_contrast;
+
+ /**
+ * Changes the image opacity
+ *
+ * Value can range between 0 and 100
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_opacity;
+
+ /**
+ * Applies threshold filter
+ *
+ * Value can range between -127 and 127
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_threshold;
+
+ /**
+ * Applies a tint on the image
+ *
+ * Value is an hexadecimal color, such as #FFFFFF
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_tint_color;
+
+ /**
+ * Applies a colored overlay on the image
+ *
+ * Value is an hexadecimal color, such as #FFFFFF
+ *
+ * To use with {@link image_overlay_opacity}
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_overlay_color;
+
+ /**
+ * Sets the opacity for the colored overlay
+ *
+ * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
+ *
+ * Unless used with {@link image_overlay_color}, this setting has no effect
+ *
+ * Default value is 50
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_overlay_opacity;
+
+ /**
+ * Inverts the color of an image
+ *
+ * Default value is FALSE
+ *
+ * @access public
+ * @var boolean;
+ */
+ var $image_negative;
+
+ /**
+ * Turns the image into greyscale
+ *
+ * Default value is FALSE
+ *
+ * @access public
+ * @var boolean;
+ */
+ var $image_greyscale;
+
+ /**
+ * Pixelate an image
+ *
+ * Value is integer, represents the block size
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var integer;
+ */
+ var $image_pixelate;
+
+ /**
+ * Applies an unsharp mask, with alpha transparency support
+ *
+ * Beware that this unsharp mask is quite resource-intensive
+ *
+ * Default value is FALSE
+ *
+ * @access public
+ * @var boolean;
+ */
+ var $image_unsharp;
+
+ /**
+ * Sets the unsharp mask amount
+ *
+ * Value is an integer between 0 and 500, typically between 50 and 200
+ *
+ * Unless used with {@link image_unsharp}, this setting has no effect
+ *
+ * Default value is 80
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_unsharp_amount;
+
+ /**
+ * Sets the unsharp mask radius
+ *
+ * Value is an integer between 0 and 50, typically between 0.5 and 1
+ * It is not recommended to change it, the default works best
+ *
+ * Unless used with {@link image_unsharp}, this setting has no effect
+ *
+ * From PHP 5.1, imageconvolution is used, and this setting has no effect
+ *
+ * Default value is 0.5
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_unsharp_radius;
+
+ /**
+ * Sets the unsharp mask threshold
+ *
+ * Value is an integer between 0 and 255, typically between 0 and 5
+ *
+ * Unless used with {@link image_unsharp}, this setting has no effect
+ *
+ * Default value is 1
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_unsharp_threshold;
+
+ /**
+ * Adds a text label on the image
+ *
+ * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n"
+ *
+ * If set, this setting allow the use of all other settings starting with image_text_
+ *
+ * Replacement tokens can be used in the string:
+ *
+ * The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture
+ *
+ * Default value is null
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text;
+
+ /**
+ * Sets the text direction for the text label
+ *
+ * Value is either 'h' or 'v', as in horizontal and vertical
+ *
+ * Note that if you use a TrueType font, you can use {@link image_text_angle} instead
+ *
+ * Default value is h (horizontal)
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text_direction;
+
+ /**
+ * Sets the text color for the text label
+ *
+ * Value is an hexadecimal color, such as #FFFFFF
+ *
+ * Default value is #FFFFFF (white)
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text_color;
+
+ /**
+ * Sets the text opacity in the text label
+ *
+ * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
+ *
+ * Default value is 100
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_opacity;
+
+ /**
+ * Sets the text background color for the text label
+ *
+ * Value is an hexadecimal color, such as #FFFFFF
+ *
+ * Default value is null (no background)
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text_background;
+
+ /**
+ * Sets the text background opacity in the text label
+ *
+ * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
+ *
+ * Default value is 100
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_background_opacity;
+
+ /**
+ * Sets the text font in the text label
+ *
+ * Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest
+ * Value can also be a string, which represents the path to a GDF or TTF font (TrueType).
+ *
+ * Default value is 5
+ *
+ * @access public
+ * @var mixed;
+ */
+ var $image_text_font;
+
+ /**
+ * Sets the text font size for TrueType fonts
+ *
+ * Value is a an integer, and represents the font size in pixels (GD1) or points (GD1)
+ *
+ * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts
+ *
+ * Default value is 16
+ *
+ * @access public
+ * @var integer;
+ */
+ var $image_text_size;
+
+ /**
+ * Sets the text angle for TrueType fonts
+ *
+ * Value is a an integer between 0 and 360, in degrees, with 0 degrees being left-to-right reading text.
+ *
+ * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts
+ * For GD fonts, you can use {@link image_text_direction} instead
+ *
+ * Default value is null (so it is determined by the value of {@link image_text_direction})
+ *
+ * @access public
+ * @var integer;
+ */
+ var $image_text_angle;
+
+ /**
+ * Sets the text label position within the image
+ *
+ * Value is one or two out of 'TBLR' (top, bottom, left, right)
+ *
+ * The positions are as following:
+ *
+ * TL T TR
+ * L R
+ * BL B BR
+ *
+ *
+ * Default value is null (centered, horizontal and vertical)
+ *
+ * Note that is {@link image_text_x} and {@link image_text_y} are used, this setting has no effect
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text_position;
+
+ /**
+ * Sets the text label absolute X position within the image
+ *
+ * Value is in pixels, representing the distance between the left of the image and the label
+ * If a negative value is used, it will represent the distance between the right of the image and the label
+ *
+ * Default value is null (so {@link image_text_position} is used)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_x;
+
+ /**
+ * Sets the text label absolute Y position within the image
+ *
+ * Value is in pixels, representing the distance between the top of the image and the label
+ * If a negative value is used, it will represent the distance between the bottom of the image and the label
+ *
+ * Default value is null (so {@link image_text_position} is used)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_y;
+
+ /**
+ * Sets the text label padding
+ *
+ * Value is in pixels, representing the distance between the text and the label background border
+ *
+ * Default value is 0
+ *
+ * This setting can be overriden by {@link image_text_padding_x} and {@link image_text_padding_y}
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_padding;
+
+ /**
+ * Sets the text label horizontal padding
+ *
+ * Value is in pixels, representing the distance between the text and the left and right label background borders
+ *
+ * Default value is null
+ *
+ * If set, this setting overrides the horizontal part of {@link image_text_padding}
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_padding_x;
+
+ /**
+ * Sets the text label vertical padding
+ *
+ * Value is in pixels, representing the distance between the text and the top and bottom label background borders
+ *
+ * Default value is null
+ *
+ * If set, his setting overrides the vertical part of {@link image_text_padding}
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_padding_y;
+
+ /**
+ * Sets the text alignment
+ *
+ * Value is a string, which can be either 'L', 'C' or 'R'
+ *
+ * Default value is 'C'
+ *
+ * This setting is relevant only if the text has several lines.
+ *
+ * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_text_alignment;
+
+ /**
+ * Sets the text line spacing
+ *
+ * Value is an integer, in pixels
+ *
+ * Default value is 0
+ *
+ * This setting is relevant only if the text has several lines.
+ *
+ * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_text_line_spacing;
+
+ /**
+ * Sets the height of the reflection
+ *
+ * Value is an integer in pixels, or a string which format can be in pixels or percentage.
+ * For instance, values can be : 40, '40', '40px' or '40%'
+ *
+ * Default value is null, no reflection
+ *
+ * @access public
+ * @var mixed;
+ */
+ var $image_reflection_height;
+
+ /**
+ * Sets the space between the source image and its relection
+ *
+ * Value is an integer in pixels, which can be negative
+ *
+ * Default value is 2
+ *
+ * This setting is relevant only if {@link image_reflection_height} is set
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_reflection_space;
+
+ /**
+ * Sets the initial opacity of the reflection
+ *
+ * Value is an integer between 0 (no opacity) and 100 (full opacity).
+ * The reflection will start from {@link image_reflection_opacity} and end up at 0
+ *
+ * Default value is 60
+ *
+ * This setting is relevant only if {@link image_reflection_height} is set
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_reflection_opacity;
+
+ /**
+ * Automatically rotates the image according to EXIF data (JPEG only)
+ *
+ * Default value is true
+ *
+ * @access public
+ * @var boolean;
+ */
+ var $image_auto_rotate;
+
+ /**
+ * Flips the image vertically or horizontally
+ *
+ * Value is either 'h' or 'v', as in horizontal and vertical
+ *
+ * Default value is null (no flip)
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_flip;
+
+ /**
+ * Rotates the image by increments of 45 degrees
+ *
+ * Value is either 90, 180 or 270
+ *
+ * Default value is null (no rotation)
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_rotate;
+
+ /**
+ * Crops an image
+ *
+ * Values are four dimensions, or two, or one (CSS style)
+ * They represent the amount cropped top, right, bottom and left.
+ * These values can either be in an array, or a space separated string.
+ * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
+ *
+ * For instance, are valid:
+ *
+ * $foo->image_crop = 20 OR array(20);
+ * $foo->image_crop = '20px' OR array('20px');
+ * $foo->image_crop = '20 40' OR array('20', 40);
+ * $foo->image_crop = '-20 25%' OR array(-20, '25%');
+ * $foo->image_crop = '20px 25%' OR array('20px', '25%');
+ * $foo->image_crop = '20% 25%' OR array('20%', '25%');
+ * $foo->image_crop = '20% 25% 10% 30%' OR array('20%', '25%', '10%', '30%');
+ * $foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25%px', '2px', '2px');
+ * $foo->image_crop = '20 25% 40px 10%' OR array(20, '25%', '40px', '10%');
+ *
+ *
+ * If a value is negative, the image will be expanded, and the extra parts will be filled with black
+ *
+ * Default value is null (no cropping)
+ *
+ * @access public
+ * @var string OR array;
+ */
+ var $image_crop;
+
+ /**
+ * Crops an image, before an eventual resizing
+ *
+ * See {@link image_crop} for valid formats
+ *
+ * Default value is null (no cropping)
+ *
+ * @access public
+ * @var string OR array;
+ */
+ var $image_precrop;
+
+ /**
+ * Adds a bevel border on the image
+ *
+ * Value is a positive integer, representing the thickness of the bevel
+ *
+ * If the bevel colors are the same as the background, it makes a fade out effect
+ *
+ * Default value is null (no bevel)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_bevel;
+
+ /**
+ * Top and left bevel color
+ *
+ * Value is a color, in hexadecimal format
+ * This setting is used only if {@link image_bevel} is set
+ *
+ * Default value is #FFFFFF
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_bevel_color1;
+
+ /**
+ * Right and bottom bevel color
+ *
+ * Value is a color, in hexadecimal format
+ * This setting is used only if {@link image_bevel} is set
+ *
+ * Default value is #000000
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_bevel_color2;
+
+ /**
+ * Adds a single-color border on the outer of the image
+ *
+ * Values are four dimensions, or two, or one (CSS style)
+ * They represent the border thickness top, right, bottom and left.
+ * These values can either be in an array, or a space separated string.
+ * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
+ *
+ * See {@link image_crop} for valid formats
+ *
+ * If a value is negative, the image will be cropped.
+ * Note that the dimensions of the picture will be increased by the borders' thickness
+ *
+ * Default value is null (no border)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_border;
+
+ /**
+ * Border color
+ *
+ * Value is a color, in hexadecimal format.
+ * This setting is used only if {@link image_border} is set
+ *
+ * Default value is #FFFFFF
+ *
+ * @access public
+ * @var string;
+ */
+ var $image_border_color;
+
+ /**
+ * Sets the opacity for the borders
+ *
+ * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
+ *
+ * Unless used with {@link image_border}, this setting has no effect
+ *
+ * Default value is 100
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_border_opacity;
+
+ /**
+ * Adds a fading-to-transparent border on the image
+ *
+ * Values are four dimensions, or two, or one (CSS style)
+ * They represent the border thickness top, right, bottom and left.
+ * These values can either be in an array, or a space separated string.
+ * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
+ *
+ * See {@link image_crop} for valid formats
+ *
+ * Note that the dimensions of the picture will not be increased by the borders' thickness
+ *
+ * Default value is null (no border)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_border_transparent;
+
+ /**
+ * Adds a multi-color frame on the outer of the image
+ *
+ * Value is an integer. Two values are possible for now:
+ * 1 for flat border, meaning that the frame is mirrored horizontally and vertically
+ * 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect
+ *
+ * The frame will be composed of colored lines set in {@link image_frame_colors}
+ *
+ * Note that the dimensions of the picture will be increased by the borders' thickness
+ *
+ * Default value is null (no frame)
+ *
+ * @access public
+ * @var integer
+ */
+ var $image_frame;
+
+ /**
+ * Sets the colors used to draw a frame
+ *
+ * Values is a list of n colors in hexadecimal format.
+ * These values can either be in an array, or a space separated string.
+ *
+ * The colors are listed in the following order: from the outset of the image to its center
+ *
+ * For instance, are valid:
+ *