-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
23 lines (18 loc) · 915 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use via .htaccess mod_rewrite rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*\.jpg).([0-9x]+)px.jpg$ bin/resizer.php?from=$1&res=$2 [L,NC]
then calling
http://yoursite/images/foo.jpg.700px.jpg
will load the 700px wide version of the image
the script will save the result back to images/foo.jpg.700px.jpg so the next time the URL is
requested, it will go straight to the actual file, skipping the PHP script invocation
supported size params:
700px - 700px wide - scale resize
x300px - 300px tall - scale resize
700x300px - scale & crop optimally (hopefully) to produce EXACTLY 700x300px image
REQUIRES Imagick's convert app
CONFIGURATION
- make sure $approot is correct
- make sure you have /usr/bin/convert
- make sure the RewriteRule has the correct path to the script
- adjust $nice to suite your needs (the default 10 should ensure resizer doesn't hog the spotlight)