Closed alexaapetrei closed 11 years ago
There is some more information about this on my blog: http://www.jenssegers.be/blog/31/CodeIgniter-resizing-and-cropping-images-on-the-fly-continued
I will try to explain you the essentials:
First you need to know that when you are using the .htaccess file, it will redirect all non-existing-file requests to codeigniter. So if you request /media/smiles-600x200.png for the first time it will redirect automatically to the media controller which resizes all images and stores at the exact same location being media/smiles-600x200.png. The next time you request the image, the user will not be redirect to the controller, but directly to the resized image!
:) thanks for the reply .
I got it working by moving the library, controller and the config file to their respective directories in my app folder. I wanted to make it work from the spark folder , would be cool if PHP had something like npm ... maybe I just need to use npm
heya , I just installed your controller using spark , and I managed to load the helper function to rewrite the image name but I'm a little stuck on how to actually pass that to the media controller to actually make the image be cropped.
Would really appreciate some hint at least :) . Other than manually copying the files to their respective folders .