function not found exif_imagetype() [Solved]

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

function not found exif_imagetype() [Solved]

Post by irish »

Hopefully this will help someone and save them a few hours of head scratching.

I installed ShopMadeSimple on a website. When I tried to upload an image for a product I was getting "function not found exif_imagetype()" I had the .dll file but it wasn't been found. The file was uploaded but the thumbnail was not created.

Solution: You need to load the mbstring extension first. Configure php.ini such that "extension=php_mbstring.dll" is placed before "extension=php_exif.dll"
Nokki211

Re: function not found exif_imagetype() [Solved]

Post by Nokki211 »

Is there another solutoin?
'Cause my hosting provider cannot do like its written above. :'(

Solved with barbarian method:
As i donot need thumbs and enlarge for images . I deleted in 'ShopMadeSimple.php' line 175 exif_imagetype function, and in file action.fe_product_list.php line 199 changed this: '$onerow->prodimage = $pathproduct.'tn_'.$picture['image'];' to this: '$onerow->prodimage = $pathproduct.$picture['image'];'
Last edited by Nokki211 on Thu Dec 17, 2009 2:42 pm, edited 1 time in total.
cms_man
Forum Members
Forum Members
Posts: 12
Joined: Mon May 04, 2009 8:00 pm

Re: function not found exif_imagetype() [Solved]

Post by cms_man »

Here is the  work around for this function


Replace the  switch on line 207 in ShopMadeSimple.php

switch(exif_imagetype($sourcedir.'/'.$image)) .......

With :

Code: Select all


list($width, $height, $type, $attr) = getimagesize($sourcedir.'/'.$image);

//  Type  of image will be  deturmine 
//1 = GIF	5 = PSD	9 = JPC	13 = SWC
//2 = JPG	6 = BMP	10 = JP2	14 = IFF
//3 = PNG	7 = TIFF(intel byte order)	11 = JPX	15 = WBMP
//4 = SWF	8 = TIFF(motorola byte order)	12 = JB2	16 = XBM

if ($type == 1)
		{$srcimg = imagecreatefromgif($sourcedir.'/'.$image);}
	elseif 
		($type == 2)   {	$srcimg = imagecreatefromjpeg($sourcedir.'/'.$image);}
     elseif 
  		($type == 3 )  {$srcimg = imagecreatefrompng($sourcedir.'/'.$image);}
Post Reply

Return to “Developers Discussion”