adding product images gives 500 error after upgrade too 3.0.11

Started by r_ekkie, October 17, 2015, 21:55:06 PM

Previous topic - Next topic

r_ekkie

Working with vm 3.0.11 (that solved my add to cart issue in 3.0.10).

But when trying to add an image to a product or a category I get a 500error. server log says the following.:

PHP Fatal error:  Call to undefined function exif_imagetype() in /../administrator/components/com_virtuemart/helpers/vmuploader.php on line 270

Any one any idea where this comes from?

Thanks

jjk

In the Joomla back-end, if you look into System > System Information > php Information, is EXIF support enabled? If not, it has to be enabled in the php.ini file.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

r_ekkie


jjk

Probably you will have to contact your webhosting service and ask them to include it.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

r_ekkie

Running my own vps. But I'll contact my tech guy. Is this a chang within 3.0.11? all other sides running 3.0.10 don't have problems

jjk

Quote from: r_ekkie on October 18, 2015, 21:13:14 PM
Is this a chang within 3.0.11? all other sides running 3.0.10 don't have problems
I don't know, because all my installations (including a 3.0.11 test installation) are running on php compilations which include exif support and I didn't notice any other report with the same issue.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Labomba

Hello r_ekkie,
I have the same problem!
Did you already solve this, if yes, how?
Best regards,

Milbo

You may try in the vmuploader.php around line 270

EDIT: THIS IS OLD

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else if(vmAccess::manager('media.potdang')){
//Just small fallback
if($mediaExtension == 'jpg' or $mediaExtension == 'png' or $mediaExtension == 'gif'){
$type = $mediaExtension;
}
} else {
$type = false;
}


EDIT: Correct code here

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Labomba

Hi Milbo,
It is not clear to me if this code should be added or modified?
If modified, than the code is non existent in my vmuploader.php

VopoloS

vmError: Invalid media, image type does not fit to extension **.jpg

Milbo

The code existing is in url /administrator/components/com_virtuemart/helpers line 270 change

$type = exif_imagetype($media['tmp_name']);


to


if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else if(vmAccess::manager('media.potdang')){
$type = false;
}
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Reijo

Same problem here but virtuemart 3.0.12
After changing
$type = exif_imagetype($media['tmp_name']);
to
if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else if(vmAccess::manager('media.potdang')){
$type = $mediaExtension;
} else {
$type = false;
}

i get error: vmError: Invalid media, image type does not fit to extension.

EXIF is not supported :S

i removed this part
if(!self::checkMediaType($type,$mediaExtension)){

vmError('Invalid media, image type does not fit to extension '.$media['name']);

return false;

}

and now its working.

Milbo

Are you sure you are superadmin or have the right to upload potentially dangerous files?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Reijo

Superadmin and i have right to upload files. I tested my wampserver same settings when exif is on and when exif is off results is same.

Labomba

Quote from: SolopoV on November 13, 2015, 12:29:44 PM
vmError: Invalid media, image type does not fit to extension **.jpg
Same problem here, how to fix this?
Before the update this all worked fine?