Bug #66516 [Com]: getimagesize() function is returning swaped values of height and width.

From: Date: Sat, 12 Sep 2015 11:23:36 +0000
Subject: Bug #66516 [Com]: getimagesize() function is returning swaped values of height and width.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195967@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66516&edit=1 ID: 66516 Comment by: nicolas33thomas at gmail dot com Reported by: milpas999 at gmail dot com Summary: getimagesize() function is returning swaped values of height and width. Status: No Feedback Type: Bug Package: GetImageSize related Operating System: windows 8.1 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I have the same issue with PHP 5.4.12. It looks to mainly happen with pictures taken with a smartphone. Here is the picture: https://drive.google.com/file/d/0B2PDHMmm8JwMbkVESkU5STZtVjA/view?usp=sharing Note that this picture has been resampled. Here is the original one: https://drive.google.com/file/d/0B2PDHMmm8JwMYTRhZ0V4ZlA2MmM/view?usp=sharing I tried with it, and I get inverted width and height value too. Previous Comments: ------------------------------------------------------------------------ [2014-12-30 10:42:20] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ [2014-01-19 16:11:03] pajoye@php.net Please provide a link to the image you use. There is certainly a rotation/orientation meta data which makes some application automatically rotate the image on load. ------------------------------------------------------------------------ [2014-01-19 16:01:34] milpas999 at gmail dot com Description: ------------ My objective is to upload an image and then to create a new image with some other 'width X height' resizing parameters. Original image has uploaded successfully, but when i am using getimagesize('local path of original uploaded image') it is returning wrong values. And this function is not working only for images of dimension '1836 X 3264' original image dimension : 1836 X 3264 and when using getimagesize() for the image it returns Array ( [0] => 3264 [1] => 1836 [2] => 2 [3] => width="3264" height="1836" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) Same as Bug #29424. but i am unsing PHP 5.4.3 and bug reporter was using PHP 5.0.0 Test script: --------------- $source_image_path = '../sysimages/origimage/20131109_151445.jpg'; $arrrrr = getimagesize($source_image_path); print("<pre>arrrrr :: "); print_r($arrrrr); print("</pre>"); Expected result: ---------------- Array ( [0] => 1836 [1] => 3264 [2] => 2 [3] => width="1836" height="3264" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) Actual result: -------------- Array ( [0] => 3264 [1] => 1836 [2] => 2 [3] => width="3264" height="1836" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66516&edit=1

« previous php.bugs (#195967) next »