projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72b10aa
)
DataObjects/Images.php
author
Alan
<alan@roojs.com>
Mon, 10 Jan 2022 05:28:19 +0000
(13:28 +0800)
committer
Alan
<alan@roojs.com>
Mon, 10 Jan 2022 05:28:19 +0000
(13:28 +0800)
DataObjects/Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
10089ae
..
1c2b325
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-841,13
+841,20
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
function createFromData($data)
{
function createFromData($data)
{
+ if (0 === strpos("data:", $data)) {
+ // data:image/png;base64,
+ $data = substr($data,5);
+ $bits = explode(";", $data);
+ $this->mimetype = $bits[0];
+ }
+
$this->mimetype= strtolower($this->mimetype);
$explode_mimetype = explode('/', $this->mimetype);
if (array_shift($explode_mimetype) == 'image') {
$this->mimetype= strtolower($this->mimetype);
$explode_mimetype = explode('/', $this->mimetype);
if (array_shift($explode_mimetype) == 'image') {
- $imgs = @getimagesize($data);
+ $imgs = @getimagesize(
'data://'.
$data);
if (!empty($imgs) && !empty($imgs[0]) && !empty($imgs[1])) {
list($this->width , $this->height) = $imgs;
if (!empty($imgs) && !empty($imgs[0]) && !empty($imgs[1])) {
list($this->width , $this->height) = $imgs;