CodeIgniter: Resize and Cache Images

Im CodeIgniter Wiki hab ich einen sehr netten Controller entdeckt: Resize and Cache

  • Images are automatically resized and cached by the path it is called by.
  • If source file is updated, the cache file(s) are automatically updated on next request.
  • If browser supports IF_MODIFIED_SINCE header, image is only returned if it has been modifed since it’s last download. This saves cpu and bandwidth on server and load time for the browser.
  • Only makes images smaller than their source, not larger.
  • Supports images in subdirectories of the main image directory.

So würde <img src="/images/size/200x200/image.gif" /> ein 200x200px Bild liefern und <img src="/images/size/200x/image.gif" /> ein Bild mit einer Breite von 200px.

Ich hatte zwar noch keine Zeit den Controller auszuprobieren, aber die Idee finde ich gut.

Possibly related posts (automatically generated)