$width = $this->width;
$height = $this->height;
-
+
if(!empty($scaleWidth)){
$width = $scaleWidth;
$height = $this->height * $scaleWidth / $this->width;
}
}
+
+ print_R($width);exit;
if(!empty($scaleHeight)){
$height = $scaleHeight;
}
}
- $im = imagecreatefromstring($data, IMG_NEAREST_NEIGHBOUR);
+ $im = imagecreatefromstring($data);
if (($scaled = imagescale($im, $width, $width)) != false) {
-
+ ob_start();
+ imagejpeg($scaled);
+ $data = ob_get_contents();
+ ob_end_clean();
+ imagedestroy($im);
+ imagedestroy($scaled);
}
}
-
-
$base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);
return $base64;