VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: r_ekkie on October 17, 2015, 21:55:06 PM

Title: adding product images gives 500 error after upgrade too 3.0.11
Post by: r_ekkie on October 17, 2015, 21:55:06 PM
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
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: jjk on October 18, 2015, 15:07:36 PM
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.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: r_ekkie on October 18, 2015, 19:38:06 PM
The whole EXIF isn't named in php information page
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: jjk on October 18, 2015, 20:20:43 PM
Probably you will have to contact your webhosting service and ask them to include it.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: r_ekkie on October 18, 2015, 21:13:14 PM
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
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: jjk on October 18, 2015, 22:10:07 PM
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.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Labomba on November 13, 2015, 10:02:03 AM
Hello r_ekkie,
I have the same problem!
Did you already solve this, if yes, how?
Best regards,
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Milbo on November 13, 2015, 11:11:55 AM
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;
}
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Labomba on November 13, 2015, 11:40:16 AM
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
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: VopoloS on November 13, 2015, 12:29:44 PM
vmError: Invalid media, image type does not fit to extension **.jpg
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Milbo on November 13, 2015, 14:19:43 PM
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;
}
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Reijo on November 16, 2015, 19:03:39 PM
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.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Milbo on November 16, 2015, 22:18:43 PM
Are you sure you are superadmin or have the right to upload potentially dangerous files?
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Reijo on November 16, 2015, 22:33:39 PM
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.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Labomba on November 17, 2015, 08:08:19 AM
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?
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: jflash on November 17, 2015, 12:45:59 PM
I confirm, if server does not have EXIF, like my testserver, then i got blank page (errors are disabled) on uploading image.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: GJC Web Design on November 17, 2015, 13:33:58 PM
as it will.. have you tried Max's fix? This will I assume be in the next release

http://forum.virtuemart.net/index.php?topic=131754.msg456411#msg456411
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Milbo on November 18, 2015, 15:23:11 PM
exchange in vmuploader.php the line 270

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


with

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: MonkeyT on November 18, 2015, 18:20:07 PM
if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}


This has solved the exact same issue on my installation of VMart 3.0.12.
Please be certain to incorporate it into the next release. 

Thank You!
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Milbo on November 18, 2015, 21:53:29 PM
Yepp :-)
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: driver_wedge on November 18, 2015, 23:37:58 PM
I had the same issue recently. My web host then enabled EXIF support on my account. Problem was sorted immediately.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: jflash on November 19, 2015, 12:54:23 PM
Quote from: Milbo on November 18, 2015, 15:23:11 PM
exchange in vmuploader.php the line 270

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


with

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}

This works for me :)
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Reijo on November 19, 2015, 13:07:13 PM
(http://omakoduleht.ee/KilaKola/thumbs.png)
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: Labomba on December 03, 2015, 08:27:11 AM
Got it working, cheers mate  8)
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: qingpool on December 07, 2015, 09:59:02 AM
Hello,

i have same issue. I asked from my provider and they said i can change my php version in cpanel and after that, choose php settings. Problem is, i dont see anything exif related there. any advice where i can check for it?
Thanks!

EDIT: Problem solved by changing PHP version on cpanel (5.5 -> 5.6) and clicking "set as current". According to my provider, clicking on any version and setting as current should have done it.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: GJC Web Design on December 07, 2015, 12:40:21 PM
It is very host dependent ..  IMHO most have exif already enabled

a few require you to choose a non-native php version and there will be the exif module selection or in the non-native it is already enabled

or you have to ask them to enable if you have no php version selector..  there is no hard and fast rule
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: papys on December 28, 2015, 13:57:27 PM
Quote from: Milbo on November 18, 2015, 15:23:11 PM
exchange in vmuploader.php the line 270

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


with

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}


Okay, this has solved the problem of white pages, but do not thumbnails
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: changlee on February 08, 2016, 11:55:12 AM
Quote from: Milbo on November 18, 2015, 15:23:11 PM
exchange in vmuploader.php the line 270

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


with

if(function_exists('exif_imagetype')){
$type = exif_imagetype($media['tmp_name']);
} else {
$type = false;
}


You ROCK! We hope to be included in the next VM update :-)
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: elgaxton on April 28, 2016, 00:53:24 AM
Thanks Milbo,

You just saved me a lot of stress
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: rado85 on July 05, 2016, 06:36:51 AM
Hi,

it worked on VM3.08. now i have 3.16 and it doesn`t work. When i upload image my thumbnail has name product-name.jpg_product
but full image is ok.
http://www.larixogrody.pl/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=129&virtuemart_category_id=18&Itemid=174


i`m wondering why in such great extenssion as virtuemart has such stupid bugs ?

Regards
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: rado85 on July 05, 2016, 12:10:50 PM
I see that issue is with scond and later image. With the first is ok.
Title: Re: adding product images gives 500 error after upgrade too 3.0.11
Post by: ttanidis on September 21, 2017, 14:56:38 PM
Quote from: Milbo on November 13, 2015, 11:11:55 AM
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;
}



Thanks! This is works for me! Joomla! 3.7.2, VirtueMart 3.2.2 & PHP Version 7.0.23