Welcome Guest, Not a member yet? Register   Sign In
getExif Error Ci4
#1

(This post was last modified: 05-11-2020, 07:55 AM by 68thorby68.)

Using CI4 I have created a very simple test script, to read the exif data of an image uploaded via ajax post. All works OK if image has exif data, but if the image does NOT contain exif data the script just fails, rather than respect the else statement. Any ideas ????

PHP Code:
if($this->request->isAJAX()) {            
            
helper(['form''url']);
            
$request = \Config\Services::request();
            
$validation =  \Config\Services::validation();            
            
            
$file $this->request->getFile('image');
            
            
$image  = \Config\Services::image()
                        ->
withFile($file);
            
            if(!
$image->getExif($file)){
                
$error_message=array('error'=>'NO EXIF');
                    return 
json_encode($error_message);
                    exit;
            }else{
                
$error_message=array('error'=>'Has EXIF');
                    return 
json_encode($error_message);
                    exit;
            }
        } 
Reply
#2

@68thorby68, are you still having this issue?
Reply
#3

Hi,

I'm not sure as wrote my own script and dont use this function.

I'll try this out later for you, but as I'm having issues installing the latest version of Ci4 (see https://forum.codeigniter.com/thread-77217-page-2.html), testing may be futile.

Many thanks for following up.
Reply
#4

I made a fix for exif read data throwing an exception. Try using the latest develop version.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB