projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ce446c
)
DataObjects/Images.php
author
edward
<edward@roojs.com>
Thu, 21 Jan 2016 05:34:32 +0000
(13:34 +0800)
committer
edward
<edward@roojs.com>
Thu, 21 Jan 2016 05:34:32 +0000
(13:34 +0800)
DataObjects/Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
15c01a7
..
3115288
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-701,20
+701,19
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
function createFromData($data)
{
function createFromData($data)
{
+
$this->mimetype= strtolower($this->mimetype);
if (array_shift(explode('/', $this->mimetype)) == 'image') {
$imgs = @getimagesize($file);
$this->mimetype= strtolower($this->mimetype);
if (array_shift(explode('/', $this->mimetype)) == 'image') {
$imgs = @getimagesize($file);
- if (empty($imgs) || empty($imgs[0]) || empty($imgs[1])) {
- // it's a file!!!!
- } else {
+ if (!empty($imgs) && !empty($imgs[0]) && !empty($imgs[1])) {
list($this->width , $this->height) = $imgs;
}
}
list($this->width , $this->height) = $imgs;
}
}
- $this->filesize = filesize($file);
+
//
$this->filesize = filesize($file);
$this->created = date('Y-m-d H:i:s');
$this->created = date('Y-m-d H:i:s');