projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DataObjects/Images.php
[Pman.Core]
/
DataObjects
/
Images.php
diff --git
a/DataObjects/Images.php
b/DataObjects/Images.php
index
f550e0e
..
96b7c88
100644
(file)
--- a/
DataObjects/Images.php
+++ b/
DataObjects/Images.php
@@
-838,7
+838,7
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
$width = $this->width;
$height = $this->height;
$width = $this->width;
$height = $this->height;
-
+
if(!empty($scaleWidth)){
$width = $scaleWidth;
if(!empty($scaleWidth)){
$width = $scaleWidth;
@@
-846,6
+846,8
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
$height = $this->height * $scaleWidth / $this->width;
}
}
$height = $this->height * $scaleWidth / $this->width;
}
}
+
+
if(!empty($scaleHeight)){
$height = $scaleHeight;
if(!empty($scaleHeight)){
$height = $scaleHeight;
@@
-855,9
+857,9
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
}
}
}
}
- $im = imagecreatefromstring($data
, IMG_NEAREST_NEIGHBOUR
);
+ $im = imagecreatefromstring($data);
- if (($scaled = imagescale($im, $width, $
width
)) != false) {
+ if (($scaled = imagescale($im, $width, $
height
)) != false) {
ob_start();
imagejpeg($scaled);
$data = ob_get_contents();
ob_start();
imagejpeg($scaled);
$data = ob_get_contents();
@@
-903,12
+905,17
@@
class Pman_Core_DataObjects_Images extends DB_DataObject
return $page;
}
return $page;
}
- function rotate()
+ function rotate(
$imageBlob = false
)
{
{
- $imagick = new Imagick($this->getStoreName());
+ if(empty($imageBlob)){
+ $imagick = new Imagick($this->getStoreName());
+ } else {
+ $imagick = new Imagick();
+ $imagick->readImageBlob($imageBlob);
+ }
$orientation = $imagick->getImageOrientation();
$orientation = $imagick->getImageOrientation();
-
+ print_R($orientation);exit;
switch($orientation) {
case Imagick::ORIENTATION_BOTTOMRIGHT:
$imagick->rotateimage(new ImagickPixel('#00000000'), 180); // rotate 180 degrees
switch($orientation) {
case Imagick::ORIENTATION_BOTTOMRIGHT:
$imagick->rotateimage(new ImagickPixel('#00000000'), 180); // rotate 180 degrees