Reputation: 11
I am having problem with changing logo image in my admin panel, it was working before but after update it outputs an error. Now I am not sure what happens and here is the error:
Call to undefined method Image::resize() …/system/controllers/settings.php
This below is the code from that area:
case 'logo-post':
if($_app_stage == 'Demo'){
r2(U.'appearance/customize/','e',$_L['disabled_in_demo']);
}
$validextentions = array("jpeg", "jpg", "png");
$temporary = explode(".", $_FILES["file"]["name"]);
$file_extension = end($temporary);
$file_name = '';
if(($_FILES["file"]["type"] == "image/png")){
$file_name = 'logo-tmp.png';
}
elseif(($_FILES["file"]["type"] == "image/jpg")){
$file_name = 'logo-tmp.jpg';
}
elseif(($_FILES["file"]["type"] == "image/jpeg")){
$file_name = 'logo-tmp.jpeg';
}
elseif(($_FILES["file"]["type"] == "image/gif")){
$file_name = 'logo-tmp.gif';
}
else{
}
if ((($_FILES["file"]["type"] == "image/png")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/jpeg"))
&& ($_FILES["file"]["size"] < 1000000)//approx. 100kb files can be uploaded
&& in_array($file_extension, $validextentions)){
move_uploaded_file($_FILES["file"]["tmp_name"], 'storage/system/'. $file_name);
$image = new Image();
$image->source_path = 'storage/system/'. $file_name;
$image->target_path = 'storage/system/logo.png';
// $image->resize('0','40',ZEBRA_IMAGE_BOXED,'-1');
$image->resize(0,0,ZEBRA_IMAGE_BOXED,'-1');
// now delete the tmp image
unlink('storage/system/'. $file_name);
// r2(U.'settings/app','s',$_L['Settings Saved Successfully']);
r2(U.'appearance/customize/','s',$_L['Settings Saved Successfully']);
}
else{
r2(U.'appearance/customize/','e',$_L['Invalid Logo File']);
}
break;
Line where the error is happening:
$image->resize(0,0,ZEBRA_IMAGE_BOXED,'-1');
I'd appreciate any help, thanks!
Upvotes: 0
Views: 1469
Reputation: 11
Thank you for all your helping here, Now i know that the image class has been change to Img as Img.php because of the updating and file image.php is contain other gb with imagelib.php. Now i changed the above code to:
All problem solved
Upvotes: 1
Reputation: 31
I think the main thing here is after update, the function Image::resize() was gone away from your file …/system/controllers/settings.php
Did you have any backup before update code? Please compare your file before and after the update, you will have the answer in this case.
Upvotes: 0