]> git.mxchange.org Git - friendica.git/blobdiff - include/Photo.php
Improvments of the HTML to make a better bb2markdown conversion (nested lists, youtub...
[friendica.git] / include / Photo.php
index 66dec061188160a7ee564fab065023280ae2b89d..3af1691ee7250880479de51ec3573fb5e2839a05 100644 (file)
@@ -124,25 +124,28 @@ class Photo {
        }
 
        public function flip($horiz = true, $vert = false) {
-        $w = imagesx($this->image);
-        $h = imagesy($this->image);
-        $flipped = imagecreate($w, $h);
+               $w = imagesx($this->image);
+               $h = imagesy($this->image);
+               $flipped = imagecreate($w, $h);
                if($horiz) {
-                for ($x = 0; $x < $w; $x++) {
-                        imagecopy($flipped, $this->image, $x, 0, $w - $x - 1, 0, 1, $h);
-                }
-        }
-        if($vert) {
-                for ($y = 0; $y < $h; $y++) {
-                        imagecopy($flipped, $this->image, 0, $y, 0, $h - $y - 1, $w, 1);
-                }
-        }
-        $this->image = $flipped;
+                       for ($x = 0; $x < $w; $x++) {
+                               imagecopy($flipped, $this->image, $x, 0, $w - $x - 1, 0, 1, $h);
+                       }
+               }
+               if($vert) {
+                       for ($y = 0; $y < $h; $y++) {
+                               imagecopy($flipped, $this->image, 0, $y, 0, $h - $y - 1, $w, 1);
+                       }
+               }
+               $this->image = $flipped;
        }
 
        public function orient($filename) {
                // based off comment on http://php.net/manual/en/function.imagerotate.php
 
+               if(! function_exists('exif_read_data'))
+                       return;
+
                $exif = exif_read_data($filename);
                $ort = $exif['Orientation'];