projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec66c81
)
DataObjects/Images.php
author
Edward
<edward@roojs.com>
Thu, 4 Oct 2018 03:00:35 +0000
(11:00 +0800)
committer
Edward
<edward@roojs.com>
Thu, 4 Oct 2018 03:00:35 +0000
(11:00 +0800)
DataObjects/Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
84b39c0
..
4edf348
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-833,14
+833,17
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
if($rotate){
$data = $this->rotate();
}
if($rotate){
$data = $this->rotate();
}
-
- if(!empty($scaleWidth) || !empty($scaleHeight)){
-
- $width = $this->width;
- $height = $this->height;
-
-
+ $width = $this->width;
+ $height = $this->height;
+
+ if(!empty($scaleWidth)){
+ $width = $scaleWidth;
+
+ if(empty($scaleHeight)){
+ $height = $this->height * $scaleWidth / $this->width;
+ }
+
}
$base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);
}
$base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);