[eluser]Johan André[/eluser]
If you use CI Upload-library use $this->upload->data() (which returns an array) and check it for key "image_width" and "image_height".
If width > height then image is landscape, if width < height then image is portrait.
If width = height then image is square!