I am trying to figure out a practical way to load/resize hero images. I would like to be able to load images through the panel and have them resized automatically. (However, I don’t even know if I need this I’m just thinking it would be a cool feature. So if this is not practical please tell me.)
I currently have hero images (both mobile and desktop) loaded through the CSS file and I also built the functionality to load them through the panel. When I load them through the panel, I resize them for both desktop and mobile and then load them through inline CSS. I am not sure how good this method is though. It seems that there will be a lot of resizing going on in the background. Am I correct?
Should I just stick to manually resizing the images and loading them through CSS, or is there a better panel approach?
Well, that’s what the method is called and that’s perfectly ok.
What is not ok, is that you miss out on checking if you have a file object before calling thumb(), without that, if the file does not exist, PHP will throw an error.