fbpx
  Thursday, 19 July 2018
  0 Replies
  0.9K Visits
  Subscribe
Hi them, i add a little script that works on sellacious 1.5.3, it auto optimizate and resize images .gif .jpeg .png

1.- open next file
<main joomla dir>/libraries/sellacious/helper/media.php

2.- Go to 426 line


3.- Next to this line


$file['path'] = ltrim($this->sanitize($path), '/ ');


add next



// -- INICIO - CUSTOM-LEONARDO ----------------------------------
if ($this->options['context']=='images')
{
$imagen = new JImage($file['tmp_name']);
$mimime = $imagen->getImageFileProperties($file['tmp_name']);
$imagen->resize('850', '850', false, 2);
$image_information = array('quality' => 70);
if($mimime->mime == 'image/gif')
{
$image_information = array('quality' => '');
}
elseif($mimime->mime == 'image/png')
{
$image_information = array('quality' => 9);
}
$imagen->toFile($file['tmp_name'], $mimime->type, array('quality' => $image_information['quality']));
unset($imagen, $mimime);
}

// -- FIN - CUSTOM-LEONARDO -------------------------------------



It just work for seller image product and not on joomla media manager, at this way you have to install a plugin. i recomend EIR plugin

bye
There are no replies made for this post yet.
Be one of the first to reply to this post!
  • +1 (408) 821-8283
  • Email hello@sellacious.com