Перейти к содержимому


Фотография
- - - - -

Image location


Лучший Ответ SmetDenis , 14 March 2014 - 08:28

Hello,

Zoo image resizeer is here
administrator\components\com_zoo\helpers\zoo.php method resizeImage()

5dd_200x0.png

Try change marked line to

$thumbfile = '/<YOUR_DIRECTORY>/'.$file_info['filename'].'_'.md5($file.$width.$height).'.'.$file_info['extension'];
Regards, SmetDenis. Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 6

#1 P.K

P.K

Отправлено 13 March 2014 - 15:59

Hi 

I wish to change the image location for the images in the cache which are stored after resizing. I wish to save them in their original folders or possibly in the /images/ directory

thanks

 


  • 0

#2 SmetDenis

SmetDenis

Отправлено 14 March 2014 - 08:28   Лучший Ответ

Hello,

Zoo image resizeer is here
administrator\components\com_zoo\helpers\zoo.php method resizeImage()

5dd_200x0.png

Try change marked line to
$thumbfile = '/<YOUR_DIRECTORY>/'.$file_info['filename'].'_'.md5($file.$width.$height).'.'.$file_info['extension'];
Regards, SmetDenis.
  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#3 P.K

P.K

Отправлено 14 March 2014 - 15:22

Worked like a charm. Just wanted to ask once image is resized i hope if it exists already it wont be resized again and again for every request

Also can i increase the $cache_time to something large value as it is static resource.

thanks


  • 0

#4 P.K

P.K

Отправлено 14 March 2014 - 15:37

also by any means can we add the type to the $thumbfile . It would make categorization and management easier


  • 0

#5 SmetDenis

SmetDenis

Отправлено 16 March 2014 - 10:10

also by any means can we add the type to the $thumbfile . It would make categorization and management easier


Hello,

Try use one of ways

// <path> / <width> / <height> / <filepath_hash>.jpg
$thumbfile = '/<YOUR_DIRECTORY>/' . $width . '/' . $height . '/' . md5($file_info['filename'].$file) . '.' . $file_info['extension'];

// <path> / <filepath> / <width> / <height> / <hash> .jpg
$file_info['dirname'] = trim($file_info['dirname'], '/\\');
$thumbfile = '/<YOUR_DIRECTORY>/' . $file_info['dirname'] . '/' . $width . '/' . $height . '/' . md5($file) . '.' . $file_info['extension'];


  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.


#6 P.K

P.K

Отправлено 16 March 2014 - 10:28

Hi Smet

The second one works but gives the complete directory of the site as /My directory/home/xyz/public_html/images/abc/def/jkl.jpg which is not desired

 

Just wanted to ask is there any variable in zoo.php which could provide the category name so that we could use that in path

 

Also please let me know more about cache time

 

Just wanted to ask once image is resized i hope if it exists already it wont be resized again and again for every request

Also can i increase the $cache_time to something large value as it is static resource.


  • 0

#7 SmetDenis

SmetDenis

Отправлено 16 March 2014 - 16:04

Hello,

Just wanted to ask is there any variable in zoo.php which could provide the category name so that we could use that in path


function resizeImage doesn't know about category, item or element that have inited resize.
So you can use only such variables as original image path, filename, new width or new height.

Also can i increase the $cache_time to something large value as it is static resource.


Yes, of course you can do it. For example set one year
$cache_time = 86400 * 365;

  • 0
JBZoo v4.0 и новый чудный мир Open Source GPL
Отключайте проверку лицензий как можно скорее!



— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.





Click to return to top of page in style!