/** * Resize and rotate the image if needed. */ private function normalizePhoto() { if ($this->normalized) { return; } $this->image->fixOrientation(); if ($this->image->height() > self::MAX_SIZE || $this->image->width() > self::MAX_SIZE) { $this->image->resize(self::MAX_SIZE); } $this->normalized = true; }