Member
Member
davidarnoult   13-03-2021, 16:26
#1

Hi!

I use in my theme this function
[code]printCustomSizedImage(gettext('Gallery'), NULL, 1140, 400, 1140, 400, NULL, NULL, 'img-fluid');[/code]
it generates the proper image with correct file name, perfect.
_w1140_h400_cw1140_ch400

I wish to precache this size in my theme:
[code]cacheManager::addCacheSize($me, null, 1140, 400, 1140, 400, null, null, false, false);[/code]
It generates a deformed image (width is reduced) with a file suffix w267_h400_cw1140_ch400

Can you give me the rule on how to get the proper CacheSize file?

Member
Member
davidarnoult   13-03-2021, 16:58
#2

Finally I found it by myself ;-)

[code]printCustomSizedImage(gettext('Gallery'), 1140, null, null, 1140, 400, null, null, 'img-fluid');[/code]

with

[code]cacheManager::addCacheSize($me, 1140, null, null, 1140, 400, null, null, false, false);[/code]

generates the exact same image with same filename and use the cache version.

Administrator
Administrator
acrylian   13-03-2021, 19:05
#3

The image parameters can be a bit tricky at times. Acthually both setting should generally create the same sized file, thus with a different name. But the 2nd seems generally the better way.

Member
Member
davidarnoult   13-03-2021, 21:26
#4

Thanks @acrylian for confirming. I had to test with different parameters, it is part of the dev process ;-)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.