Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
More clarification in How it works
  • Loading branch information
Marko Markovic committed Oct 8, 2010
1 parent 38c660c commit 2455ea6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.markdown
Expand Up @@ -87,11 +87,27 @@ If the file is updated, you simply delete the folder with its thumbnails and the

## How it works?

The helper generates a IMG tag that looks like this:
The helper generates, for example, a IMG tag that looks like this:

<img src="/thumbs/img/cake.icon.png/eyJyb3RhdGVJbWFnZU5EZWdyZWVzIjpbMTgwXSwiYWRhcHRpdmVSZXNpemUiOlszMDAsMzAwXX0=.png" width="200" height="200" alt="Upside down cake" />

Because of the rules in the .htaccess file, if the file exists, web server is simply going to serve it so the image generation is not triggered. If it's not there, the plugin is called and the thumbnail is generated, saved to the target file and served.
Because of the rules in the .htaccess file, if the file exists, web server is simply going to serve it so the image generation is not triggered. If it's not there, the plugin controller is called. The string *eyJyb3RhdGVJbWFnZU5EZWdyZWVzIjpbMTgwXSwiYWRhcHRpdmVSZXNpemUiOlszMDAsMzAwXX0=* is decoded to

stdClass Object
(
[rotateImageNDegrees] => Array
(
[0] => 180
)

[adaptiveResize] => Array
(
[0] => 300
[1] => 300
)
)

and those actions with other parameters are passed to ImageEditor which generates the thumbnail, saves it to the target file and serves it.


[1]: http://phpthumb.gxdlabs.com/

0 comments on commit 2455ea6

Please sign in to comment.