• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getEXIF error on some files...bug?

#1
Almost put in a bug in GitHub, but wanted to post here first and see if it's valid:



- OS: MacOS 10.14.6

- Web server Apache/2.2.34 (local)

- PHP version 7.3.7

- CodeIgniter 4.0.0-rc.2



My Controller Code:



Code:
$image = \Config\Services::image();
$exif = $image
->withFile(WRITEPATH.'uploads/'.$newName)
->getEXIF();




Expecting the getEXIF function to return the results of exif_read_data, which it does for some files but on others the following error was logged:



CRITICAL - 2019-10-09 02:02:51 --> exif_read_data(my-jpg.jpg): Incorrect APP1 Exif Identifier Code

#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'exif_read_data(...', '/Directory/...', 544, Array)

#1 /Directory/framework-master/system/Images/Handlers/BaseHandler.php(544): exif_read_data('/MyFolder/...')

#2 /MyFolder/framework-master/app/Controllers/Images.php(55): CodeIgniter\Images\Handlers\BaseHandler->getEXIF()

#3 /MyFolder/framework-master/system/CodeIgniter.php(844): App\Controllers\Images->upload()

#4 /MyFolder/framework-master/system/CodeIgniter.php(335): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Images))

#5 /MyFolder/framework-master/system/CodeIgniter.php(245): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)

#6 /MyFolder/framework-master/public/index.php(45): CodeIgniter\CodeIgniter->run()

#7 {main}



I can provide it if needed.



Will be happy to file the bug in GitHub if appropriate.



Thanks,

Derek
Reply

#2
EXIF is not supported on GIF files - we made a change for that 3 weeks ago ... https://github.com/codeigniter4/CodeIgniter4/pull/2246

It looks like you are trying to retrieve the info for a JPEG (my-jpg.jpg) - is that correct? If so, is the JPEG properly encoded?
Reply

#3
Thanks for the quick reply!

The file is a JPEG and I'm honestly not positive about how to check the encoding, but I ran this in terminal (note it's a different test file):

file -I /Mypath/_DSC_0047_34657.jpg
/Mypath/_DSC_0047_34657.jpg: image/jpeg; charset=binary
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.