I have a code where view is rendered programatically and it contains an image field. However usually images are coming from nodes where different image style is applied so location of image is in different folder. If I preview the view manually style is applied and images appear in the proper styles folder but if this is executed by code it doesnt happen. Anyone with ideas how easily to trigger application of image styles from the code without walking each returned image field, checking is image style applied and so on.
1 Answer
I went with only solution which came to my mind - foreach the view results, check the image fields and then apply image style and create derivatives. Because when view render image fields programatically it doesn't actually set the files in proper styles folder, it is done on browser request but this doesnt suit our use case.