Bug #66519 [NEW]: All EXIF related functions randomly return error

From: Date: Mon, 20 Jan 2014 10:20:38 +0000
Subject: Bug #66519 [NEW]: All EXIF related functions randomly return error
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183910@lists.php.net to get a copy of this message
From:             staviq at gmail dot com
Operating system: Windows 2012
PHP version:      5.5.8
Package:          EXIF related
Bug Type:         Bug
Bug description:All EXIF related functions randomly return error

Description:
------------
All EXIF related function randomly out of nowhere return:

Warning: exif_thumbnail(***FILENAME***): File too small (0) in
***SCRIPTNAME*** on line XXX

Sometimes function like "exif_thumbnail", or "exif_read_data" will give
me expected result, like a tumbnail or array of properties, but most of
the time ( about 90% ) it will give me mentioned error.

Tried on php 5.5.6 ( XAMPP bundled ) and 5.5.8 ( downloaded from
php.net, used with nginx )

Test script:
---------------
<?
$i = "***FILENAME***";
$image = exif_thumbnail($i, $width, $height, $type);
if( max( $width, $height ) == $width )
{
	$w = 256;
	$h = 256*( $height/$width );
}
else
{
	$h = 256;
	$w = 256*( $height/$width );
}
echo "<img style=\"width: ".$w."px; height: ".$h."px;\"
src='data:image/jpeg;base64,".base64_encode($image)."'>";
?>

Expected result:
----------------
Consistent result, either error every time, or expected thumbnail every
time.

Actual result:
--------------
Warning: exif_thumbnail(P1030005.JPG): File too small (0) in
E:\xampp\htdocs\t3.php on line 3

Warning: Division by zero in E:\xampp\htdocs\t3.php on line 7


-- 
Edit bug report at https://bugs.php.net/bug.php?id=66519&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66519&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66519&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66519&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66519&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66519&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66519&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66519&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66519&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66519&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66519&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66519&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66519&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66519&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66519&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66519&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66519&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66519&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66519&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66519&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66519&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#183910) next »