Ignore:
Timestamp:
May 7, 2015 12:28:04 PM (10 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php

    r905 r913  
    1717    public function executeIndex() {
    1818        $this->forward('default', 'module');
    19     }
    20 
    21     private function createImateThumbnail($fileName, &$thumnail = '') {
    22         $thumnailPath = dirname($fileName);
    23         $rawFileName = str_replace($thumnailPath, '', $fileName);
    24         $thumbnailfileName = substr($rawFileName, 0, strlen($rawFileName) - 4) . '_thumb.jpg';
    25         list($width, $height) = getimagesize($fileName);
    26         $new_width = 64;
    27         $new_height = 50;
    28         $image_p = imagecreatetruecolor($new_width, $new_height);
    29         $image = imagecreatefromjpeg($fileName);
    30         imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    31         $thumnail = $thumnailPath . $thumbnailfileName;
    32         return imagejpeg($image_p, $thumnailPath . $thumbnailfileName, 30);
    3319    }
    3420
     
    159145        $tblfile->setFileType($currentFile->getFileType());
    160146        $tblfile->setFileDate(date('Y-m-d H:i:s'));
    161         $tblfile->save(); 
     147        $tblfile->save();
    162148
    163149        $c = new Criteria();
     
    483469        }
    484470
    485        
    486 
    487471        if ($response == 1) {
    488472            $aryError = array('err' => "", 'errCode' => 0);
    489473            $ext = pathinfo($fileUrl, PATHINFO_EXTENSION);
    490474            $thumbnail = "";
    491             if (in_array($ext, array("jpg", "jpeg", "png", "gif", "tiff", "dvg", "bmp"))) {
     475            if (in_array(strtolower($ext), array("jpg", "jpeg", "png", "gif", "tiff", "dvg", "bmp"))) {
    492476            $thumbnail=violetUtil::createThumb($filePath);
    493477            }
Note: See TracChangeset for help on using the changeset viewer.