Bug #76521 [Ver->Fbk]: getimagesize() fails on photos from Samsung S8

From: Date: Fri, 22 Jun 2018 14:19:13 +0000
Subject: Bug #76521 [Ver->Fbk]: getimagesize() fails on photos from Samsung S8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215865@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76521&edit=1 ID: 76521 Updated by: requinix@php.net Reported by: opajaap at opajaap dot nl Summary: getimagesize() fails on photos from Samsung S8 -Status: Verified +Status: Feedback Type: Bug -Package: GetImageSize related +Package: GD related PHP Version: 7.1.18 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: Works for me. Array ( [0] => 4032 [1] => 3024 [2] => 2 [3] => width="4032" height="3024" [bits] => 8 [channels] => 3 [mime] => image/jpeg ) The @ will hide errors. If you have a problem then hiding errors is not good. Remove the @. Previous Comments: ------------------------------------------------------------------------ [2018-06-22 14:19:09] cmb@php.net I can reproduce this on current PHP-7.2. As soon as the $imageinfo parameter is given, getimagesize() returns FALSE without any notice/warning. ------------------------------------------------------------------------ [2018-06-22 13:24:09] peehaa@php.net What is the actually error getimagesize returns? ------------------------------------------------------------------------ [2018-06-22 13:20:00] opajaap at opajaap dot nl Description: ------------ Seen on PHP 7.1.13 and 7.2.5 getimagesize() executed on a just uploaded photofile from a Samsung S8 phone does not return an array. Url to sample photo: https://betatest.opajaap.nl/wp-content/wppa-depot/20180522_102730.jpg Test script: --------------- // $file = <filepath to just uploaded photofile (.jpg) $src_size = @getimagesize( $file, $info ); // If the given file is not an image file, log error and exit if ( ! $src_size ) { echo ( sprintf( 'ERROR: File %s is not a valid picture file.', $file ) ); return false; } // This prints the errormessage, while the photo looks normal on a windows pc ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76521&edit=1

« previous php.bugs (#215865) next »