Hi, I'm facing some php funny issues while im getting image sizes from php. These are my codes: Javascript getimagesize sample code: <html> <body> <script> // landscape var l = new Image(); l.onload = function() { alert('landscape: width ( ' + this.width + 'px ), height ( ' + this.height + 'px )'); } l.src = 'landscape.jpg'; // portrait var p = new Image(); p.onload = function() { alert('portrait: width ( ' + this.width + 'px ), height ( ' + this.height + 'px )'); } p.src = 'portrait.jpg'; </script> </body> </html> HTML: PHP getimagesize sample code: <?php list($wl, $hl) = getimagesize('landscape.jpg'); list($wp, $hp) = getimagesize('portrait.jpg'); print "<p>landscape: width( " . $wl . "px ), ( " . $hl . "px )</p>"; print "<p>portrait: width( " . $wp . "px ), ( " . $hp . "px )</p>"; ?> PHP: Please Find Attached Simple Sample Code: http://www.muhammadsameer.com/projects/php_getimagesize/watermarks.rar Please Check Attached Images For Help: I've described in detail everything in this IMAGE. http://www.muhammadsameer.com/projects/php_getimagesize/issue-getimagesize.jpg http://www.muhammadsameer.com/projects/php_getimagesize/thumb-getimagesize.jpg
The images you provided was both 5184x3456, I don't see the problem? PHP reads horizontal pixels as width, and vertical pixels as height regardless of what angle you took your picture from.
I have had the same issues with php not getting the right dimensions. I have disbanded this method and simply did not use it at all anymore.
My problem is now solved Try this thread. http://w3schools.invisionzone.com/index.php?showtopic=48241