Skip to content

Commit

Permalink
_save calls fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Sep 11, 2012
1 parent f4cbafb commit f2afa9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,15 @@ public function upload($fp, $dst, $name, $tmpname) {
}

$stat = array(
'mime' => $mime,
'w' => 0,
'h' => 0,
'size' => filesize($tmpname));
'mime' => $mime,
'width' => 0,
'height' => 0,
'size' => filesize($tmpname));

// $w = $h = 0;
if (strpos($mime, 'image') === 0 && ($s = getimagesize($tmpname))) {
$stat['w'] = $s[0];
$stat['h'] = $s[1];
$stat['width'] = $s[0];
$stat['height'] = $s[1];
}
// $this->clearcache();
if (($path = $this->_save($fp, $dstpath, $name, $stat)) == false) {
Expand Down Expand Up @@ -2545,11 +2545,11 @@ protected function copyFrom($volume, $src, $destination, $name) {
} else {
// $mime = $source['mime'];
// $w = $h = 0;
// if (strpos($mime, 'image') === 0 && ($dim = $volume->dimensions($src))) {
// $s = explode('x', $dim);
// $w = $s[0];
// $h = $s[1];
// }
if (($dim = $volume->dimensions($src))) {
$s = explode('x', $dim);
$source['width'] = $s[0];
$source['height'] = $s[1];
}

if (($fp = $volume->open($src)) == false
|| ($path = $this->_save($fp, $destination, $name, $source)) == false) {
Expand Down
2 changes: 1 addition & 1 deletion php/elFinderVolumeLocalFileSystem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ protected function _subdirs($path) {

/**
* Return object width and height
* Ususaly used for images, but can be realize for video etc...
* Usualy used for images, but can be realize for video etc...
*
* @param string $path file path
* @param string $mime file mime type
Expand Down
4 changes: 2 additions & 2 deletions php/elFinderVolumeMySQL.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ protected function _save($fp, $dir, $name, $stat) {
$this->clearcache();

$mime = $stat['mime'];
$w = !empty($stat['w']) ? $stat['w'] : 0;
$h = !empty($stat['h']) ? $stat['h'] : 0;
$w = !empty($stat['width']) ? $stat['width'] : 0;
$h = !empty($stat['height']) ? $stat['height'] : 0;

$id = $this->_joinPath($dir, $name);
rewind($fp);
Expand Down

0 comments on commit f2afa9f

Please sign in to comment.