Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Easy thumbnail generation using PHP
Mar 25, 2011 @ 13:19:57

Sameer Borate has a recent post to his blog looking at a PHP_Thumb tool.

One of the frequent requirements in web design is that of thumbnail generation. Although there are many libraries out there I found PHP Thumb simple and quick enough to implement in a recent project. PHP Thumb is a light-weight image manipulation library aimed at thumbnail generation. It offers the ability to resize, create custom crops, or square crops from the center, and rotate the image. If the need arises you can also easily add custom functionality to the library through plugins.

Code examples are, of course, included in the post showing simple thumbnail creation, image rotation, cropping, resizing and outputting to a different format. There's a brief mention of custom plugins and the ability to chain functions.

tagged: thumbnail generation phpthumb generation tutorial

Link:

MrPHP.com.au:
Image Cache using phpThumb and .htaccess
Oct 15, 2008 @ 16:12:14

Brett send in a link to a new post on his "Mr PHP" blog about a method he's come up with to cache images using the phpThumb library.

Generate thumbs by visiting a URL such as your.com/thumbs/images/image.50x50.jpg. This will create a 50x50px thumbnail of your.com/images/image.jpg. The thumb will be stored on your server at your.com/thumbs/images/image.50x50.jpg so the next request for the same image will be loaded without loading php for ultra fast image cache.

The phpThumb tool lets you dynamically resize an image and, if one does not exist for it, make a thumbnail that's output and cached. From then on the script just pulls from that local copy. He includes his code to get it working and the mod_rewrite rule that maps an image request back to it (so it's still "/images/myimage.jpg" instead of "/app/phpThumb.php?src=myimage.jpg&w=100&h=100" in the img src).

tagged: image cache phpthumb modrewrite img src tutorial

Link:

The Bakery:
Four New Articles/Tutorials
May 10, 2007 @ 14:35:00

The Bakery has four new articles/tutorials they've posted lately looking at things like thumbnail generation, data validation and add/delete behavior.

  • Thumbnails generation with phpThumb - phpThumb is a great thumbnail generator, it can generate thumbs with GD, GD2 or ImageMagick. There are many features like crop, rotate, watermark,... see all the features on the phpThumb homepage.
  • HABTM Add & Delete Behavior - Many people gripe about the HABTM associations in CakePHP and how difficult it is to add or delete a single record. This behavior takes care of the task for you!
  • Flexible controller and modelpaths - This short tutorial will show you how to organize your model and controller in subfolders of the controllers and models folders!
  • Rails-like Data Validation - Validate your data like in rails: http://rails.rubyonrails.com/classes/ActiveRecord/Validations/ClassMethods.html
There's more great content where these came from, so be sure to check out the rest of The Bakery for more great tips.

tagged: cakephpframework datavalidation phpthumb controller modelpaths cakephpframework datavalidation phpthumb controller modelpaths

Link:

The Bakery:
Four New Articles/Tutorials
May 10, 2007 @ 14:35:00

The Bakery has four new articles/tutorials they've posted lately looking at things like thumbnail generation, data validation and add/delete behavior.

  • Thumbnails generation with phpThumb - phpThumb is a great thumbnail generator, it can generate thumbs with GD, GD2 or ImageMagick. There are many features like crop, rotate, watermark,... see all the features on the phpThumb homepage.
  • HABTM Add & Delete Behavior - Many people gripe about the HABTM associations in CakePHP and how difficult it is to add or delete a single record. This behavior takes care of the task for you!
  • Flexible controller and modelpaths - This short tutorial will show you how to organize your model and controller in subfolders of the controllers and models folders!
  • Rails-like Data Validation - Validate your data like in rails: http://rails.rubyonrails.com/classes/ActiveRecord/Validations/ClassMethods.html
There's more great content where these came from, so be sure to check out the rest of The Bakery for more great tips.

tagged: cakephpframework datavalidation phpthumb controller modelpaths cakephpframework datavalidation phpthumb controller modelpaths

Link:


Trending Topics: