khashnan / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

user definable percentage for crop location #190

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've added the percentage ('p') parameter which accepts a number between 0 and 
100 representing a percentage. It works in combination with the alignment 
parameter like this:

- t : 0 represents the top alignment, 100 represents the bottom alignment 
(equivalent to alignment setting 'b') and values in between represent a 
proportional alignment of the crop area (see example below);

- b : 0 represents the bottom alignment, and 100 represents the top alignment 
(equivalent to alignment setting 't');

- l : 0 represents the left alignment, and 100 represents the right alignment 
(equivalent to alignment setting 'r'); and

- r : 0 represents the right alignment, and 100 represents the left alignment 
(equivalent to alignment setting 'l');

Original issue reported on code.google.com by daniel%h...@gtempaccount.com on 23 May 2011 at 3:20

Attachments:

GoogleCodeExporter commented 8 years ago
See some notes here http://harves.net/2011/05/playing-with-timthumb/

Original comment by daniel%h...@gtempaccount.com on 23 May 2011 at 3:24

GoogleCodeExporter commented 8 years ago
Patch file attached for current svn HEAD.

Original comment by daniel%h...@gtempaccount.com on 23 May 2011 at 3:30

Attachments:

GoogleCodeExporter commented 8 years ago
Notes FYI regarding the timthumb.php attached here (not the patch file):
1. Contains my domain in allowed sites (harves.net) - you won't want this.
2. Also contains the '%20' substitution removed from clean_source() recently 
(as I want this).

Just so you know.

Original comment by daniel%h...@gtempaccount.com on 23 May 2011 at 3:32

GoogleCodeExporter commented 8 years ago
Very useful. 
I just change how to get value of parameter "p" (similar to others parameters, 
standard way)

$percentage = (int) abs ($this->param('p', 0));

Original comment by gianluig...@gmail.com on 13 May 2012 at 3:53