projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7949317
)
DataObjects/Images.php
author
edward
<edward@roojs.com>
Wed, 6 Sep 2017 03:27:04 +0000
(11:27 +0800)
committer
edward
<edward@roojs.com>
Wed, 6 Sep 2017 03:27:04 +0000
(11:27 +0800)
DataObjects/Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
9c312c0
..
47d3ad6
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-768,7
+768,15
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
function toBase64()
{
+ $file = $this->getStoreName();
+ if(!file_exists($file)){
+ return '';
+ }
+
+ $type = pathinfo($path, PATHINFO_EXTENSION);
+ $data = file_get_contents($path);
+ $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
}
}