}
- function toBase64()
+ function toBase64($rotate = false)
{
if(!preg_match('/^image\//', $this->mimetype)){
return false;
$data = file_get_contents($file);
+ if($rotate){
+ $data = $this->rotate();
+ }
+
$base64 = 'data:' . $this->mimetype . ';base64,' . base64_encode($data);
return $base64;