public function upload_image()
 {
     // error_reporting(0);
     include dirname(__FILE__) . '/../Util/image-cropper-config.class.php';
     include dirname(__FILE__) . '/../Util/image-cropper-function.class.php';
     if ($_GET['act'] == 'thumb') {
         preg_match('/Uploaded\\/.*/', $_POST['img_src'], $matches);
         $img_src = APP_PATH . 'Public/' . $matches[0];
         $arr = array('uploaddir' => $imgthumb, 'tempdir' => $imgtemp, 'web_dir' => $webthumb, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => $_POST['x'], 'y' => $_POST['y'], 'img_src' => $img_src, 'thumb' => true, 'fileError' => $fileError, 'sizeError' => $sizeError, 'maxfilesize' => $maxuploadfilesize, 'canvasbg' => $canvasbg);
         resizeThumb($arr);
         exit;
     } elseif ($_GET['act'] == 'upload') {
         $big_arr = array('uploaddir' => $imgbig, 'tempdir' => $imgtemp, 'web_dir' => $webbig, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => 0, 'y' => 0, 'fileError' => $fileError, 'sizeError' => $sizeError, 'maxfilesize' => $maxuploadfilesize, 'canvasbg' => $canvasbg);
         resizeImg($big_arr);
     } else {
         //nothing to do here
     }
 }
Exemple #2
0
<?php

require "../../require/function.php";
//print $_GET['act'];
if ($_GET['act'] == 'thumb') {
    $arr = array('uploaddir' => __uploaddir__, 'tempdir' => __uploaddir__, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => $_POST['x'], 'y' => $_POST['y'], 'img_src' => $_POST['img_src'], 'thumb' => true, 'new_name' => $_POST['indice'] . $_POST['newname'] . '.jpg');
    resizeThumb($arr);
    exit;
} elseif ($_GET['act'] == 'upload') {
    $filename = $_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . $_POST['racine'] . ".jpg";
    @unlink($filename);
    $filename = $_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . "tbl_" . $_POST['racine'] . ".jpg";
    @unlink($filename);
    for ($i = 1; $i < $_POST['nb'] + 1; $i++) {
        $filename = $_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . "tbl_" . $i . $_POST['racine'] . ".jpg";
        @unlink($filename);
    }
    $big_arr = array('uploaddir' => __uploaddir__, 'tempdir' => __uploaddir__, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => 0, 'y' => 0, 'new_name' => $_POST['newname'] . '.jpg');
    resizeImg($big_arr);
} else {
    //
}
Exemple #3
0
 public function upload()
 {
     // disable error if you want
     //error_reporting(0);
     include_once DIR_SYSTEM . 'upload/config.php';
     include_once DIR_SYSTEM . 'upload/functions.php';
     if ($this->request->get['act'] == 'thumb') {
         $arr = array('uploaddir' => $imgthumb, 'tempdir' => $imgtemp, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => $_POST['x'], 'y' => $_POST['y'], 'img_src' => $_POST['img_src'], 'thumb' => true, 'fileError' => $fileError, 'sizeError' => $sizeError, 'maxfilesize' => $maxuploadfilesize, 'canvasbg' => $canvasbg, 'bigWidthPrev' => $bigWidthPrev, 'bigHeightPrev' => $bigHeightPrev);
         resizeThumb($arr);
         exit;
     } elseif ($this->request->get['act'] == 'upload') {
         $big_arr = array('uploaddir' => $imgbig, 'tempdir' => $imgtemp, 'height' => $_POST['height'], 'width' => $_POST['width'], 'x' => 0, 'y' => 0, 'thumb' => false, 'fileError' => $fileError, 'sizeError' => $sizeError, 'maxfilesize' => $maxuploadfilesize, 'canvasbg' => $canvasbg, 'bigWidthPrev' => $bigWidthPrev, 'bigHeightPrev' => $bigHeightPrev);
         resizeImg($big_arr);
     } else {
         //nothing to do here
     }
 }