Welcome, Guest
Username: Password: Remember me

TOPIC: Warning: Division by zero and No Image

Warning: Division by zero and No Image 10 years 1 week ago #558

Purchased this Module with great Expectation: But showing error

Warning: Division by zero in /home/evarthak/public_html/modules/mod_jo_k2_responsive_scroller/lib/resize-class.php on line 335


And Image thumbs are not displaying. (please see attached)

PHP Version 5.4.26
Web Server Apache/2.2.27
WebServer to PHP Interface
Joomla! Version Joomla! 3.2.3 Stable [ Ember ] 6-March-2014 14:30 GMT

Expecting Some Help and thanks
Attachments:
The administrator has disabled public write access.

Warning: Division by zero and No Image 10 years 1 week ago #559

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hi
Find and open file: modules/mod_jo_k2_responsive_scroller/helper.php
Go to line 294->309 and changed
if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg'))
{
$item->imageMedium = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg';
$resizeObj = new resize($item->imageMedium);
$resizeObj -> resizeImage($params->get('thumbwidth'), $params->get('thumbheight'), 'crop');
$resizeObj -> saveImage($destination.'/jo_k2_responsive_scroller/'.'p'.$params->get('thumbwidth').'x'.$params->get('thumbheight').'/'.md5("Image".$item->id).'_M.jpg', 100);
$item->image_thumb = JURI::root().'images/jo_k2_responsive_scroller/'.'p'.$params->get('thumbwidth').'x'.$params->get('thumbheight').'/'.md5("Image".$item->id).'_M.jpg';
}elseif (!empty($matches[1][0])) {
$item->imageMedium = $matches[1][0];
$resizeObj = new resize($matches[1][0]);
$resizeObj -> resizeImage($params->get('thumbwidth'), $params->get('thumbheight'), 'crop');
$resizeObj -> saveImage($destination.'/jo_k2_responsive_scroller/'.'p'.$params->get('thumbwidth').'x'.$params->get('thumbheight').'/'.md5("Image".$item->id).'_M.jpg', 100);
$item->image_thumb = JURI::root().'images/jo_k2_responsive_scroller/'.'p'.$params->get('thumbwidth').'x'.$params->get('thumbheight').'/'.md5("Image".$item->id).'_M.jpg';
}else{
$item->image_thumb = '';
}
To
if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg'))
{
$item->imageMedium = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg';
$item->image_thumb = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg';
}elseif (!empty($matches[1][0])) {
$item->imageMedium = $matches[1][0];
$item->image_thumb = $matches[1][0];
}else{
$item->image_thumb = '';
}
Or can you send me joomla administrator via contact form? So i can help you
Best regards
Bach Pham
The administrator has disabled public write access.

Warning: Division by zero and No Image 10 years 1 week ago #560

After following your instructions, I could get the module worked. Still facing problem with thumbnail. Image Height not getting resized. I fixed width 195px and height 120px but height resize not working.

Is there any solution?.

Also find a conflict with UniteCMS' Revolution Responsive Slider.


Thank you for the quick response. I send Joomla Administrator details using Contact Form.

Thanks again.
Last Edit: 10 years 1 week ago by Jeena Rajeev. Reason: I could do some modification meanwhile
The administrator has disabled public write access.

Warning: Division by zero and No Image 10 years 1 week ago #561

  • Super User
  • Super User's Avatar
  • OFFLINE
  • Administrator
  • Posts: 3519
  • Thank you received: 278
  • Karma: 65
Hello Jeena
We have changed and fixed the problem in your site and now it work fine. Can you check it
Best regards
Bach Pham
The administrator has disabled public write access.
Time to create page: 0.089 seconds