1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-25 17:00:44 +02:00

Compare commits

..

306 Commits

Author SHA1 Message Date
Mikael Roos
21e53887b8 prepare to tag v0.7.15 2016-08-09 10:19:49 +02:00
Mikael Roos
66c5a07767 webp partly working 2016-08-09 09:32:02 +02:00
Mikael Roos
bbfd895c4c webp implemented but fail to verify 2016-08-08 16:49:29 +02:00
Mikael Roos
b5de49d601 add debug for test 2016-08-08 16:48:23 +02:00
Mikael Roos
7677fc772f remove debugging 2016-08-08 16:21:36 +02:00
Mikael Roos
3d0b25abe0 test support for webp images 2016-08-08 16:13:51 +02:00
Mikael Roos
1e5de9d225 Added the [Lenna/Lena sample
image](http://www.cs.cmu.edu/~chuck/lennapg/) as tif and created a png,
jpeg and webp version using Imagick convert `convert lena.tif
lena.{png,jpg,webp}`.
2016-08-08 14:42:12 +02:00
Mikael Roos
43cb5b79b2 prepare to tag v0.7.14 2016-08-08 12:20:01 +02:00
Mikael Roos
8e10e9ba5c Re-add removed cache directory. 2016-08-08 12:19:31 +02:00
Mikael Roos
1738680301 Make fast track cache disabled by default in the config file. 2016-08-08 12:19:04 +02:00
Mikael Roos
9b110037b4 prepare to tag v0.7.13 2016-08-08 11:35:12 +02:00
Mikael Roos
9a912e7f01 prepare to merge 2016-08-08 11:33:04 +02:00
Mikael Roos
689865a8b2 even more testing 2016-08-08 11:19:53 +02:00
Mikael Roos
493ed45311 more test 2016-08-08 10:44:27 +02:00
Mikael Roos
72c04632b8 more test 2016-08-08 10:39:11 +02:00
Mikael Roos
b1d0cb1506 prepare to test 2016-08-08 09:29:26 +02:00
Mikael Roos
c637fa23ef test with imgf 2016-07-18 16:38:57 +02:00
Mikael Roos
6cccf5497d added and fixed fast track cache script version 2016-07-18 01:00:55 +02:00
Mikael Roos
0dd562aa61 add really fast track cache script 2016-07-18 00:44:46 +02:00
Mikael Roos
9a0a9429db make debug depend on file exists 2016-07-10 22:57:58 +02:00
Mikael Roos
6118f298ff prepare to test fast track cache 2016-07-10 22:54:11 +02:00
Mikael Roos
32a23894d1 cleanup, removed code comments, codestyle 2016-06-01 10:11:44 +02:00
Mikael Roos
cde8bab6e7 tagging v0.7.12 2016-06-01 09:37:28 +02:00
Mikael Roos
5edbfc9b54 prepare to tag v0.7.12 2016-06-01 09:34:30 +02:00
Mikael Roos
9e9c44c935 Fixed to correctly display image when using a resize strategy without height or width. 2016-06-01 09:31:28 +02:00
Mikael Roos
9088647d3a Fixed background color for option , #144. 2016-06-01 09:30:18 +02:00
Mikael Roos
8ad324b4f5 update readme with latest version number 2016-04-18 16:09:49 +02:00
Mikael Roos
3b16b4b79d prepare to tag v0.7.11 2016-04-18 15:58:39 +02:00
Mikael Roos
4e940164f9 Add option for skip_original to config file to always skip original, #118. 2016-04-18 15:53:55 +02:00
Mikael Roos
1943d6606b update years in license 2016-04-01 11:25:36 +02:00
Mikael Roos
5eebaa66ce update to latest version 2016-04-01 10:32:44 +02:00
Mikael Roos
c5cc0314c2 prepare to tag v0.7.10 2016-04-01 10:30:25 +02:00
Mikael Roos
71816261f2 prepare to merge master 2016-04-01 10:27:33 +02:00
Mikael Roos
a62d7cb6c2 Add backup option for images src-alt, #141. 2016-04-01 10:24:24 +02:00
Mikael Roos
ccbd08949f add for testcase #134 2016-01-26 17:40:10 +01:00
Mikael Roos
6467fcc748 Add require of ext-gd in composer.json, #133. 2016-01-14 16:19:00 +01:00
Mikael Roos
14d22a18e5 Merge pull request #133 from abcdmitry/patch-1
Add GD extension to the composer requiremets
2016-01-14 16:17:43 +01:00
Dmitry Lukashin
6d3687d838 Add PHP extensions to the composer requirements 2016-01-14 16:03:13 +03:00
Mikael Roos
ad8f6c12ee creating bundles 2015-12-07 17:40:00 +01:00
Mikael Roos
ad4930c3ae Fix strict mode only reporting 404 when failure, #127. 2015-12-07 17:39:34 +01:00
Mikael Roos
f250f7dff9 recreating bundles 2015-12-07 16:02:17 +01:00
Mikael Roos
05c11ca9fc refixing new cache management for remote images 2015-12-07 16:01:47 +01:00
Mikael Roos
b069e322e9 create bundles 2015-12-07 15:36:06 +01:00
Mikael Roos
6e0c775ede clear whitespace 2015-12-07 15:35:19 +01:00
Mikael Roos
179469334a bundles to include CCache 2015-12-07 15:31:41 +01:00
Mikael Roos
0b2723feee Strict mode only reporting 404 when failure, #127. 2015-12-07 15:30:34 +01:00
Mikael Roos
c009f423a2 tested cahce with remote 2015-12-07 15:22:52 +01:00
Mikael Roos
79a7fd17d8 improved cache handling for remote, #130 2015-12-07 15:12:20 +01:00
Mikael Roos
3271d165ff add correct version to remote headers, fix #131 2015-12-07 10:09:26 +01:00
Mikael Roos
1dc04e7c53 fix invalid composer.json 2015-12-06 20:45:44 +01:00
Mikael Roos
376a40e538 adding CCache to improve cache handling of dummy and srgb 2015-12-06 19:53:34 +01:00
Mikael Roos
29743b75ec prepare to tag v0.7.8 2015-12-06 12:47:47 +01:00
Mikael Roos
902c0aaef8 generate new bundles 2015-12-06 12:40:54 +01:00
Mikael Roos
6c487c6f34 ignore build dir 2015-12-06 12:38:17 +01:00
Mikael Roos
a1d811a318 Merge branch '078' 2015-12-06 12:37:11 +01:00
Mikael Roos
a205d65ad5 moving to new travis environment 2015-12-06 12:27:54 +01:00
Mikael Roos
22f24cc75a remove whitespace 2015-12-06 12:26:20 +01:00
Mikael Roos
28be266d15 moving to new travis environment 2015-12-06 12:25:22 +01:00
Mikael Roos
044e3e3c66 prepare to test 078 2015-12-06 12:18:33 +01:00
Mikael Roos
c32ae6dace remove whitespace 2015-12-06 12:05:24 +01:00
Mikael Roos
ef397f5c02 Merge branch 'Anatolie-errors' 2015-12-06 11:59:27 +01:00
Mikael Roos
b871dd7f1c update docs/api with phpdoc 2015-12-02 11:05:41 +01:00
Mikael Roos
91ae49b3f3 More examples on dealing with cache through bash bin/cache.bash, #129. 2015-12-02 11:04:42 +01:00
Mikael Roos
8e1318c31e enable code coverage whitelist 2015-12-02 11:02:42 +01:00
Mikael Roos
9c81286efa adding hook for gitter 2015-12-02 11:02:03 +01:00
Anatolie Diordita
d7b34a6488 Updated to reflect changes proposed in issue #127 2015-11-29 15:23:39 -05:00
Mikael Roos
39cee7647e Added Gitter badge to README, #126. 2015-11-25 10:04:24 +01:00
Mikael Roos
b3dd2a7623 Merge pull request #126 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-11-25 10:00:44 +01:00
Anatolie Diordita
3c22db4392 Added specific HTTP status messages to each error. 2015-11-24 17:00:53 -05:00
The Gitter Badger
8aea13ba33 Add Gitter badge 2015-11-23 12:57:52 +00:00
Mikael Roos
ccacc9e0c1 Merge pull request #125 from sonyarianto/master
fix the proper download URL
2015-11-18 18:00:36 +01:00
Sony AK
b93d1242db fix the proper download URL 2015-11-18 11:34:22 +07:00
Mikael Roos
f9a4205579 correcting test 2015-10-26 21:09:32 +01:00
Mikael Roos
0efcfd5bc7 add srgb as part of cache filename 2015-10-24 16:42:59 +02:00
Mikael Roos
7a98a44dd4 Added conversion to sRGB using option ?srgb. #120. 2015-10-24 15:43:56 +02:00
Mikael Roos
aedce7021f Added conversion to sRGB using option , partly working, #120 2015-10-23 14:19:46 +02:00
Mikael Roos
1f012ac19e production should be default mode 2015-10-22 16:52:08 +02:00
Mikael Roos
a62425e759 make htacces work in its current environment. 2015-10-22 16:43:16 +02:00
Mikael Roos
3667082f15 update version number 2015-10-21 01:23:23 +02:00
Mikael Roos
80610b31b9 generated new bundles 2015-10-21 01:13:36 +02:00
Mikael Roos
b639220d05 prepare to tag v0.7.7 2015-10-21 01:13:18 +02:00
Mikael Roos
ee9fdb8474 One can now add a HTTP header for Cache-Control in the config file, #109. 2015-10-21 01:12:10 +02:00
Mikael Roos
db5ce71926 Added hook in img,php before CImage is called, #123. 2015-10-21 00:51:56 +02:00
Mikael Roos
1bf57fe8ef Added hook in img,php before CImage is called, #123. 2015-10-21 00:51:48 +02:00
Mikael Roos
8c89166967 Added configuration for default jpeg quality and png compression in the config file, #107. 2015-10-21 00:30:01 +02:00
Mikael Roos
ce8ec325d3 Strip comments and whitespace in imgs.php. 2015-10-21 00:13:56 +02:00
Mikael Roos
ca9b4a4ce6 webroot/img/issue117/img.php?src=issue117%2Ftri_original.png 2015-10-21 00:05:14 +02:00
Mikael Roos
7c0f37628f Adding option &status to get an overview of the installed ond configured utilities, #116. 2015-10-21 00:04:37 +02:00
Mikael Roos
5fe8e399a1 * Added option to decide if resample or resize when copying images internally. &no-resample makes resize, instead of resample as is default.
* Verbose now correctly states if transparent color is detected.
* Removed that source png-files, containing less than 255 colors, is always saved as palette images since this migth depend on processing of the image.
2015-10-20 13:46:01 +02:00
Mikael Roos
9620c1eb75 Adding testcase for issue #117 2015-10-20 13:45:16 +02:00
Mikael Roos
f721ef4b35 Adding save-as as part of the generated cache filename, #121. 2015-10-20 10:26:09 +02:00
Mikael Roos
37b39fbecf Add extra fileds to json-response, #114. 2015-10-20 10:04:37 +02:00
Mikael Roos
553d2f3db1 Add header for Content-Length, #111. 2015-10-18 18:34:42 +02:00
Mikael Roos
9e2bd27c6e Add check for postprocessing tools in path in webroot/check_system.php, #104. 2015-10-18 18:13:12 +02:00
Mikael Roos
1bd6fc8a2c improving dummy image 2015-10-18 17:15:14 +02:00
Mikael Roos
39b6078d84 travis working again, unintentionally removed the cache dirs 2015-10-18 16:25:50 +02:00
Mikael Roos
e7e73fc38c testin travis 2015-10-18 16:22:42 +02:00
Mikael Roos
fa77908616 testin travis 2015-10-18 16:13:45 +02:00
Mikael Roos
0f05cd06e5 testin travis 2015-10-18 16:11:59 +02:00
Mikael Roos
3d773b502d testint travis 2015-10-18 16:04:48 +02:00
Mikael Roos
575c712bd0 testint travis 2015-10-18 16:02:27 +02:00
Mikael Roos
cdd159e142 testing travis 2015-10-18 15:52:06 +02:00
Mikael Roos
f21cd923f3 testing travis 2015-10-18 15:50:22 +02:00
Mikael Roos
18fb271961 add writable cache dir 2015-10-18 15:48:11 +02:00
Mikael Roos
1fdc701f3d prepare to test v0.7.5 2015-10-18 15:43:43 +02:00
Mikael Roos
dc6e9a8708 test tag 2015-10-18 14:52:17 +02:00
Mikael Roos
d9947251ab prepare to merge 2015-10-18 14:44:27 +02:00
Mikael Roos
0fb00df972 adding feature for creating dummy images, #101 2015-09-17 11:24:30 +02:00
Mikael Roos
f00b2e0cd3 adding feature for creating dummy images, #101 2015-09-17 11:22:50 +02:00
Mikael Roos
fd2ddadc44 Add png compression to generated cache filename, fix #103. 2015-09-16 09:51:04 +02:00
Mikael Roos
ea4794f4a2 remove commented code 2015-09-16 09:19:46 +02:00
Mikael Roos
7af0b6ef8a remove commented code 2015-09-16 09:18:51 +02:00
Mikael Roos
850fb76c8b cleanup unused variables 2015-09-16 09:09:30 +02:00
Mikael Roos
49f5f66ad3 calling setSource(null) should unset imageSrc and pathToImage 2015-09-16 08:26:28 +02:00
Mikael Roos
a787593533 Removing unneded internal variable this->imageFolder 2015-09-16 08:21:32 +02:00
Mikael Roos
8d6a8a452e Prepare to tag v0.7.4 2015-09-15 17:26:04 +02:00
Mikael Roos
1907feffc8 Rewriting some comments 2015-09-15 17:24:10 +02:00
Mikael Roos
afff3589dc Generate filename with filters, does not work on Windows, fix #100. 2015-09-15 17:23:22 +02:00
Mikael Roos
76bc09f2ee Add CAsciiArt.php to composer for autoloading, fix #102. 2015-09-15 17:19:29 +02:00
Mikael Roos
c4d3f7cdf6 prepare to tag 2015-09-01 17:02:11 +02:00
Mikael Roos
a50aab9d8e Prepare to test asciiart 2015-09-01 16:53:19 +02:00
Mikael Roos
de942268c9 Updating version information 2015-09-01 16:53:02 +02:00
Mikael Roos
d8090e7531 Merge branch 'master' into ascii 2015-09-01 16:49:30 +02:00
Mikael Roos
c94027a752 Prepare to generate bundles with asciiart 2015-09-01 16:46:44 +02:00
Mikael Roos
2959f11f33 Adding support for AsciiArt of an image. 2015-09-01 16:45:10 +02:00
Mikael Roos
cf8bb8973d prepared to tag v0.7.2 and regenerated bundles 2015-08-17 20:35:25 +02:00
Mikael Roos
d8db2b9105 Prepare to test #98 2015-08-17 20:28:08 +02:00
Mikael Roos
b65b420313 Updating with release information 2015-07-25 23:28:24 +02:00
Mikael Roos
c5f35e5743 preparing to tag v0.7.1 2015-07-25 23:20:21 +02:00
Mikael Roos
6a9ef0fbbc Correcting defaults for password 2015-07-25 23:04:55 +02:00
Mikael Roos
b881832a08 Correcting defaults for password 2015-07-25 23:04:27 +02:00
Mikael Roos
555c3f0185 * Support for password hashes using text, md5 and hash, fix #77. 2015-07-25 22:58:04 +02:00
Mikael Roos
aaf34fd0b5 Update revision 2015-07-25 22:25:17 +02:00
Mikael Roos
8bc710f3b8 * Using CWhitelist for checking hotlinking to images, fix #88.
* Added mode for `test` which enables logging verbose mode to file, fix #97.
2015-07-25 22:21:12 +02:00
Mikael Roos
01a868d925 Improved codestyle and added to start using phpcs to check code style, fix #95. 2015-07-23 11:32:19 +02:00
Mikael Roos
aaaffb606a adding branch alias again 2015-07-20 21:59:42 +02:00
Mikael Roos
805d765515 changing autoload to classmap 2015-07-20 21:56:56 +02:00
Mikael Roos
eebcee5fc9 removing branch alias 2015-07-20 21:52:41 +02:00
Mikael Roos
fcf6ff7605 Changing version 2015-07-20 21:32:59 +02:00
Mikael Roos
7bce32c652 Adding branch alias to dev master 2015-07-20 21:24:20 +02:00
Mikael Roos
2ca25ca956 Adding branch alias to dev master 2015-07-20 21:21:51 +02:00
Mikael Roos
20d53b406e Adding PSR-0 to composer.json 2015-07-20 21:16:53 +02:00
Mikael Roos
da827444a0 Create composer.json 2015-06-29 19:39:05 +02:00
Mikael Roos
f6ceb47c83 Update htaccess
Add RewriteEngine on to make the htaccess-file working out of the box., Fix #93.
2015-06-29 19:14:44 +02:00
Mikael Roos
d9ce501df3 remove ECMA 6 construct of for of 2015-05-08 10:47:22 +02:00
Mikael Roos
c87ba5087c compare deal with images leaving no json information 2015-05-08 09:58:32 +02:00
Mikael Roos
9eb2996d05 Add permalink to setup for comparing images with webroot/compare/compare.php, fix #92. 2015-05-08 09:39:10 +02:00
Mikael Roos
7a0626d9bf Add permalink to setup for comparing images with webroot/compare/compare.php, fix #92. 2015-05-08 09:38:12 +02:00
Mikael Roos
0c0b5ef672 allow space in image filename by default, fix #91 2015-04-28 14:27:21 +02:00
Mikael Roos
2651c9ea02 Support redirections for remote images, fix #87, fix #90. 2015-03-18 15:58:25 +01:00
Mikael Roos
a8e1718208 improving useage of travis & scrutinizer 2015-03-16 16:29:32 +01:00
Mikael Roos
41089833ca improving useage of travis & scrutinizer 2015-03-16 16:20:54 +01:00
Mikael Roos
fba8d6343b improving useage of travis & scrutinizer 2015-03-16 16:19:23 +01:00
Mikael Roos
ae5dae83ea improving useage of travis & scrutinizer 2015-03-16 16:10:37 +01:00
Mikael Roos
6dea19f8cb improving useage of travis & scrutinizer 2015-03-16 16:06:57 +01:00
Mikael Roos
9aeb8b7859 improving useage of travis & scrutinizer 2015-03-16 16:05:57 +01:00
Mikael Roos
ded8a43bc3 Naming cache-file using md5 for remote images, fix #86 2015-03-16 15:36:06 +01:00
Mikael Roos
fca6979ba6 note for #85 2015-03-06 13:55:22 +01:00
Mikael Roos
f5529c7431 Loading images without depending on filename extension, fix #85. 2015-03-06 13:00:21 +01:00
Mikael Roos
169b99eab3 updating phpdoc 2015-03-06 12:38:36 +01:00
Mikael Roos
8a7a056694 minor correction to testcase 2015-03-06 12:35:23 +01:00
Mikael Roos
70c83455e2 minor correction to testcase 2015-03-06 12:34:53 +01:00
Mikael Roos
d5b75e611c adding notification to irc 2015-03-04 13:41:18 +01:00
Mikael Roos
8b442f4e69 including 84 2015-03-04 12:35:38 +01:00
Mikael Roos
8d3a605500 rearranging files to bin 2015-03-04 11:32:33 +01:00
Mikael Roos
2c03cde379 Adding unittest with phpunit #84, fix #13 2015-03-04 11:32:11 +01:00
Mikael Roos
f37189c378 adding support for whitelist of remote hostnames, #84 2015-03-04 11:29:10 +01:00
Mikael Roos
160b426468 adding test for curl 2015-03-04 11:22:34 +01:00
Mikael Roos
66db11974d adding support for scrutinizer, fix #57 2015-03-04 11:12:39 +01:00
Mikael Roos
96c183a616 adding support for travis, fix #15 2015-03-04 11:11:28 +01:00
Mikael Roos
817c1de8f7 moved to bin dir for improved structure 2015-03-04 11:07:42 +01:00
Mikael Roos
6269b113d1 adding phpdoc fix #48 2015-03-04 11:01:55 +01:00
Mikael Roos
e9037bc0ed adding phpdoc fix #48 2015-03-04 11:00:36 +01:00
Mikael Roos
1de4830c96 ready for version 0.7.0 2015-02-10 23:56:24 +01:00
Mikael Roos
12796f4263 for release 0.7 2015-02-10 23:10:23 +01:00
Mikael Roos
26a5013593 for release 0.7 2015-02-10 23:09:41 +01:00
Mikael Roos
68176e2d45 for release 0.7 2015-02-10 23:08:00 +01:00
Mikael Roos
c32a594f62 for release 0.7 2015-02-10 23:05:15 +01:00
Mikael Roos
e5ca711c8a for release 0.7 2015-02-10 23:04:29 +01:00
Mikael Roos
2b76fb689c updated versions for single scripts 2015-02-10 22:50:15 +01:00
Mikael Roos
fb9b89a65f updated versions for single scripts 2015-02-10 22:49:17 +01:00
Mikael Roos
c2b037af0d preparing to release v0.7.0-rc-1 2015-02-10 22:45:20 +01:00
Mikael Roos
889dba1ddb Always use password, setting in img_config.php, fix #78. 2015-02-10 22:41:24 +01:00
Mikael Roos
0baea7c346 adding transparent images for test 2015-02-09 08:03:31 +01:00
Mikael Roos
ab4e8a6fae Resize gif keeping transparency #81. 2015-02-09 00:43:38 +01:00
Mikael Roos
641d67d7a0 Resize gif keeping transparency #81. 2015-02-09 00:42:49 +01:00
Mikael Roos
aa009510be Resize gif keeping transparency #81. 2015-02-09 00:40:55 +01:00
Mikael Roos
9348141e65 rename 2015-02-09 00:37:25 +01:00
Mikael Roos
800dcbc248 rename 2015-02-08 19:53:34 +01:00
Mikael Roos
7b18030580 replacing with other testimage 2015-02-08 19:52:51 +01:00
Mikael Roos
e5738c02b1 adding animated gif 2015-02-08 19:52:20 +01:00
Mikael Roos
6478915f3c adding testimage for gif animation 2015-02-08 19:20:10 +01:00
Mikael Roos
ba58ce80c0 adding testimage png transparent 2015-02-08 19:19:42 +01:00
Mikael Roos
d4d645a00e adding transparent gif for test 2015-02-08 19:04:02 +01:00
Mikael Roos
011148b0e8 correcting mode-setting in config 2015-02-02 12:43:55 +01:00
Mikael Roos
eb0fc69036 correcting mode-setting in config 2015-02-02 12:43:01 +01:00
Mikael Roos
c012cb2537 testing before release v0.7.0 2015-02-02 12:39:58 +01:00
Mikael Roos
16a7a3dad5 * Now returns statuscode 500 when something fails #55.
* Three different modes: strict, production, development #44.
* Three files for all-in-one `imgs.php`, `imgp.php`, `imgd.php` #73.
2015-01-29 21:16:32 +01:00
Mikael Roos
bc4e04c3cb change name of all-in-one-file to imgs.php #73 2015-01-28 19:52:10 +01:00
Mikael Roos
3452ea1908 Add all code into one single script #73 2015-01-27 22:40:28 +01:00
Mikael Roos
5e08e5ed80 Enable in config to disallow hotlinking/leeching #46 2015-01-19 00:00:54 +01:00
Mikael Roos
4fae208c4c alias now requires password to work. alias filename is without extension #47. 2015-01-17 19:16:39 +01:00
Mikael Roos
f87dc2967f adding support for alias #47 2015-01-15 23:29:18 +01:00
Mikael Roos
c35587c7e2 create caache directory for remote download if it does not exists #43 2015-01-14 21:00:08 +01:00
Mikael Roos
81e70b7acd Introduced default values for almost all confguration options #72 2015-01-14 20:47:48 +01:00
Mikael Roos
8e9a3b68f0 ready for test of remote images #43 2015-01-14 19:33:35 +01:00
Mikael Roos
61afe445f1 ready for test of remote images #43 2015-01-14 19:32:01 +01:00
Mikael Roos
be98ae8979 ready for merge #43 2015-01-14 19:28:52 +01:00
Mikael Roos
f9704a4fbc remote download #43 2015-01-10 20:17:12 +01:00
Mikael Roos
254ddf11f0 pre 0.7 before integrating with remote images 2015-01-08 18:03:15 +01:00
Mikael Roos
d21daa298c pre 0.7 before integrating with remote images
* Adding compare-page for comparing images. Issue #20.
* Added option `no-upscale, nu` as resizing strategy to decline upscaling of smaller images. Fix #61.
* Minor change in `CImage::resize()`, crop now does imagecopy without resamling.
* Correcting internal details for save-as and response json which indicated wrong colors. Fix #62.
* Fixed fill-to-fit that failed when using aspect-ratio. Fix #52.
* JSON returns correct values for resulting image. Fix #58.
* Corrected behaviour for skip-original. Fix #60.
2015-01-08 18:01:48 +01:00
Mikael Roos
cae7a49d21 adding class for remote access 2014-12-23 10:46:00 +01:00
Mikael Roos
f4b3f16443 Adding compare-page for comparing images. 2014-12-19 15:23:21 +01:00
Mikael Roos
b5100845e9 Adding compare-page for comparing images. Issue #20. 2014-12-19 15:21:47 +01:00
Mikael Roos
8c4b22ca66 Prepare to rewrite the resize-method with respect to no-upscale code. 2014-12-15 17:45:21 +01:00
Mikael Roos
d509067759 updating strategies to use for no-upscale, #61 2014-12-15 17:24:49 +01:00
Mikael Roos
5fa05e8282 updating strategies to use for no-upscale 2014-12-15 17:16:41 +01:00
Mikael Roos
1144c8e105 updating strategies to use for no-upscale 2014-12-15 17:14:06 +01:00
Mikael Roos
90bfced741 Added option - no-upscale, nu - as resizing strategy to decline upscaling of smaller images. Fix #61. 2014-12-15 15:41:51 +01:00
Mikael Roos
61e0473f47 CImage::resize now crops using imagecopy without resamling. 2014-12-15 09:41:11 +01:00
Mikael Roos
2dbe33bd8e Correcting internal details for save-as and response json which indicated wrong colors. Fix #62. 2014-12-15 09:24:14 +01:00
Mikael Roos
ece0be086c Correcting internal details for save-as and response json which indicated wrong colors. Fix #62. 2014-12-15 09:19:23 +01:00
Mikael Roos
e236757e5d adding testcases for resizing strategies 2014-12-15 09:18:41 +01:00
Mikael Roos
951231f360 Fixed fill-to-fit that failed when using aspect-ratio. Fix #52. 2014-12-14 17:09:29 +01:00
Mikael Roos
34124e687f Removed &nc 2014-12-14 17:09:12 +01:00
Mikael Roos
ea06d5cfe6 Fixed fill-to-fit that failed when using aspect-ratio. Fix #52. 2014-12-14 17:04:51 +01:00
Mikael Roos
cfc4a5f0ed JSON returns correct values for resulting image. Fix #58. 2014-12-13 00:23:40 +01:00
Mikael Roos
00dca21be0 Corrected behaviour for skip-original. Fix #60 2014-12-13 00:12:39 +01:00
Mikael Roos
9680cd421b spelling 2014-12-06 15:53:14 +01:00
Mikael Roos
b335587aa4 prepare to tag v0.6 2014-12-06 15:39:18 +01:00
Mikael Roos
afa59313e6 prepare to tag v0.6 2014-12-06 15:29:48 +01:00
Mikael Roos
5dddad60eb prepare to tag v0.6 2014-12-06 15:27:16 +01:00
Mikael Roos
af1aa661b9 rewrote docs. tested. prepare to tag v0.6 2014-12-06 14:33:47 +01:00
Mikael Roos
9015e7ce9d Minor cleaning of properties in CImage, fix #23 2014-12-03 16:15:32 +01:00
Mikael Roos
7911a88d6e Adding webroot/htaccess to show off how friendly urls can be created for img.php. 2014-12-03 16:06:16 +01:00
Mikael Roos
2b6952b0ca Adding webroot/htaccess to show off how friendly urls can be created for img.php. Fix #45 2014-12-03 16:04:10 +01:00
Mikael Roos
640e377ea9 Adding webroot/htaccess to show off how friendly urls can be created for img.php. Fix #45 2014-12-03 16:03:46 +01:00
Mikael Roos
cdbc9b4adb correcting issue with PHP 5.3 where array is used as constant 2014-12-03 15:42:49 +01:00
Mikael Roos
3aa5542664 changing comment for bgc. 2014-12-03 15:31:38 +01:00
Mikael Roos
3d352f72fe Merge branch 'master' of github.com:mosbth/cimage 2014-12-03 15:26:38 +01:00
Mikael Roos
f13b602e11 Added option fill-to-fit, ff. Fix #38. 2014-12-03 15:26:17 +01:00
Mikael Roos
f638dd16a7 Added option fill-to-fit, ff. Fix #38. 2014-12-03 15:25:03 +01:00
Mikael Roos
113b62edc0 Added option 'shortcut, sc' to enable configuration of complex expressions. Fix #2. 2014-11-28 16:25:54 +01:00
Mikael Roos
3c04a2dd0f Added support for custom convolutions. Fix #49. 2014-11-27 22:04:41 +01:00
Mikael Roos
832edc9d26 restructured test programs 2014-11-26 15:16:02 +01:00
Mikael Roos
2d09ea4b44 Restructured test-programs. 2014-11-26 15:13:41 +01:00
Mikael Roos
9177d72bea Check if constants exists. Fix #42 2014-11-26 14:45:38 +01:00
Mikael Roos
d4a03b70dd Adding testcase for #40 2014-11-24 10:46:50 +01:00
Mikael Roos
188f8cd64d Adding option taking comma-separated list of 11 float-values, wraps and exposes . #4 2014-11-24 09:27:47 +01:00
Mikael Roos
4dfbcd9784 Changing ppi to dpr. #25 2014-11-24 07:41:32 +01:00
Mikael Roos
35dd5c9064 Adding option which defaults to 1. Set to 2 to get a twice as large image. Useful for Retina displays. Basically a shortcut to enlarge the image. #25 2014-11-21 23:44:19 +01:00
Mikael Roos
1f5f8c02a4 Adding utility to ease gathering stats on cache usage. #21 2014-11-21 23:14:38 +01:00
Mikael Roos
08ee3064d0 * Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5 2014-11-21 22:31:04 +01:00
Mikael Roos
ba45f746bb * Cache now uses same file extension as original image #37.
* Can output image as json format using `json` #11.
2014-11-21 22:20:30 +01:00
Mikael Roos
ccc59fbb3a Prepare to tag v0.5.3 2014-11-21 21:14:19 +01:00
Mikael Roos
e85bc6cee5 Adding testfiles with capital extension 2014-11-21 21:12:22 +01:00
Mikael Roos
3b7485b3b9 Support filenames of uppercase JPEG, JPG, PNG and GIF, as proposed in #37. 2014-11-21 21:01:22 +01:00
Mikael Roos
c83eac8c3c Changing CImage::output() as proposed in #37. 2014-11-21 20:20:35 +01:00
Mikael Roos
78ac29752e Adding security check that image filename is always below the path
`image_path` as specified in `img_config.php` #37.
2014-11-21 19:57:11 +01:00
Mikael Roos
4b64237a4c Changeing comment 2014-11-21 19:37:33 +01:00
Mikael Roos
85f0e3e7d3 moving testilfes to one dir 2014-11-21 19:35:04 +01:00
Mikael Roos
da227d49dd Use the new config item for checking valid filename characters. 2014-11-21 19:34:01 +01:00
Mikael Roos
26449a3236 Adding configuration item to set what valid characters are for the image
filename.
2014-11-21 19:32:05 +01:00
Mikael Roos
20a4f848b7 Moved all test-files into own directory. 2014-11-21 19:24:36 +01:00
Mikael Roos
ec3a6f3491 check if extension exif is loaded #36 2014-09-01 01:27:45 +02:00
Mikael Roos
8523ef5e31 adding testcases for #36 2014-09-01 00:38:26 +02:00
Mikael Roos
63112f58b1 Cleaning up code #23, added rotate and autoRotate #36 2014-08-31 23:58:02 +02:00
Mikael Roos
c96ed10f80 Cleaning up code #23, added rotate and autoRotate #36 2014-08-31 23:57:34 +02:00
Mikael Roos
67524bd090 Adding MIT license text as should be. 2014-08-21 02:46:00 +02:00
Mikael Roos
1f9a11747b Readding cache dir 2014-08-21 02:37:58 +02:00
Mikael Roos
4ed55d59e3 finally setting jpeg_ignore_warning to true #34 2014-08-21 02:30:32 +02:00
Mikael Roos
8dde82993b improving error handling when opening (non)-recoverable images 2014-08-21 02:23:15 +02:00
Mikael Roos
fb261b1b05 improving error handling when opening (non)-recoverable images 2014-08-21 02:22:20 +02:00
Mikael Roos
1a6cef6580 improving error handling when opening (non)-recoverable images 2014-08-21 02:21:32 +02:00
Mikael Roos
2643d4954f must have @ before open images, warning contra notice, recoverable and non recoverable 2014-08-21 02:13:01 +02:00
Mikael Roos
ef1d56085a Verbose error when failing to open image 2014-08-21 02:08:49 +02:00
Mikael Roos
28cda0ea28 changing error handling to dir when failing to open a corrupt image 2014-08-21 02:02:50 +02:00
Mikael Roos
ed9949b717 adding corrupt jpegs for #34 2014-08-21 01:37:05 +02:00
Mikael Roos
c249a472d6 adding pre 2014-08-21 01:25:19 +02:00
Mikael Roos
c8c2e5f95f updated with change #34 2014-08-21 01:20:50 +02:00
Mikael Roos
8db8501eb0 Setting gd.jpeg_ignore_warning to true #34 as default 2014-08-21 01:19:56 +02:00
Mikael Roos
2b0b3859a7 Extended info printed #35 2014-08-21 00:31:05 +02:00
Mikael Roos
1e70883771 Now sends 404 header as it should #32 when providing a error page 2014-08-20 23:55:23 +02:00
Mikael Roos
b2002d0087 Now sends 404 header as it should #32 when providing a error page 2014-08-20 23:54:13 +02:00
Mikael Roos
9aac0cde8e Removed old description, its in the README now, focus on testcases. 2014-08-20 23:49:25 +02:00
Mikael Roos
3dec1d0a6d Merge pull request #33 from garagesocial/patch-2
Update CImage.php
2014-08-15 08:54:59 +02:00
Garagesocial
577e5fa5d4 Update CImage.php 2014-08-15 02:07:07 -04:00
Mikael Roos
38a6c86317 Merge pull request #31 from garagesocial/patch-1
Comment Typo CImage.php
2014-08-07 08:18:17 +02:00
Garagesocial
dcb390a17b Comment Typo CImage.php 2014-08-06 19:02:55 -04:00
Mikael Roos
9e461787c7 comment reflected wrongly to area variabel, issue #29 2014-05-20 01:39:51 +02:00
Mikael Roos
a96cd7a4cc changed colors 2014-05-20 01:15:53 +02:00
Mikael Roos
98d971204f correcting links to image 2014-05-20 01:04:26 +02:00
Mikael Roos
9707065b9e trying and failing to verify issue 29 2014-05-20 00:56:30 +02:00
Mikael Roos
5cd953b9b3 issue 29 and code formatting 2014-05-20 00:56:08 +02:00
Mikael Roos
b4f51f3438 code formatting and making log() public 2014-05-20 00:55:43 +02:00
Mikael Roos
dedd01bc71 Helper to check if img.php is supported on this system 2014-05-20 00:12:46 +02:00
Mikael Roos
67d0cf27ee code formatting and slightly reformatted verbose output 2014-05-20 00:12:09 +02:00
Mikael Roos
161fdfe769 code formatting 2014-05-20 00:00:27 +02:00
Mikael Roos
6cff9ac105 better error reporting for development environment 2014-05-19 23:59:50 +02:00
Mikael Roos
ec42c41e4d Verified known bug - sharpen acts as blur in PHP 5.5.9 and 5.5.10 #28 2014-04-01 08:56:38 +02:00
Mikael Roos
f12d02b8c1 Correcting issue #27 and removing default config-options from img.php 2014-04-01 08:44:38 +02:00
Mikael Roos
1673cd7aca Correcting issue #26 2014-04-01 08:11:49 +02:00
Mikael Roos
0fee846437 tag v0.5.1 2014-02-12 15:29:58 +01:00
Mikael Roos
c63747a892 Adding empty cache-directory to repo 2014-02-12 15:25:29 +01:00
Mikael Roos
2d8cccc795 Display image in README 2014-02-12 15:22:52 +01:00
Mikael Roos
bb5fd6f115 Display image in README 2014-02-12 15:22:06 +01:00
257 changed files with 64730 additions and 770 deletions

20
.gitignore vendored
View File

@@ -1,4 +1,16 @@
# Cache files #
######################
cache/_*

# Cache files
cache/*
# Test
coverage/
coverage.clover
# Composer
composer.lock
vendor
# Build and test
build/
# Mac OS
.DS_Store

46
.scrutinizer.yml Normal file
View File

@@ -0,0 +1,46 @@
imports:
- php
filter:
excluded_paths:
- test/
- webroot/check*
- webroot/imgd.php
- webroot/imgp.php
- webroot/imgs.php
- webroot/test/
checks:
php:
code_rating: true
duplication: true
tools:
# Copy/Paste Detector
php_cpd: true
# Metrics
php_pdepend: true
# Some Metrics + Bug Detection/Auto-Fixes
php_analyzer: true
php_code_sniffer:
config:
standard: "PSR2"
php_sim:
min_mass: 16 # Defaults to 16
php_mess_detector:
#config:
# ruleset: ../your-phpmd-ruleset/ruleset.xml
build:
tests:
override:
-
command: 'phpunit'
coverage:
file: 'coverage.clover'
format: 'php-clover'

93
.travis.yml Normal file
View File

@@ -0,0 +1,93 @@
language: php
php:
- 5.4
- 5.5
- 5.6
- hhvm
- nightly
- "7.0"
sudo: false
git:
submodules: false
addons:
apt:
packages:
#- php-codesniffer
#- phpmd
#- shellcheck
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_script:
# Create a build directory for output
# Store all files in your own bin
#- install --directory build/bin
#- export PATH=$PATH:$PWD/build/bin/
# Install validation tools
#- npm install -g htmlhint csslint jshint jscs jsonlint js-yaml html-minifier@0.8.0 clean-css uglify-js
# Install phpcs
#- curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
#- install --mode 0755 phpcs.phar $PWD/build/bin/phpcs
# Install phpmd
#- wget -c http://static.phpmd.org/php/latest/phpmd.phar
#- install --mode 0755 phpmd.phar $PWD/build/bin/phpmd
script:
# Check versions of validation tools
#- node --version
#- npm --version
#- htmlhint --version
#- csslint --version
#- jscs --version
#- jshint --version
#- phpcs --version
#- phpmd --version
#- jsonlint --version
#- js-yaml --version
#- shellcheck --version
#- html-minifier --version
#- cleancss --version
#- uglifyjs --version
# Run validation & publish
#- make phpunit
- composer validate
- phpunit
#- make phpcs
notifications:
irc: "irc.freenode.org#dbwebb"
webhooks:
urls:
- https://webhooks.gitter.im/e/a89832db4f939e85ba97
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

212
CAsciiArt.php Normal file
View File

@@ -0,0 +1,212 @@
<?php
/**
* Create an ASCII version of an image.
*
*/
class CAsciiArt
{
/**
* Character set to use.
*/
private $characterSet = array(
'one' => "#0XT|:,.' ",
'two' => "@%#*+=-:. ",
'three' => "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. "
);
/**
* Current character set.
*/
private $characters = null;
/**
* Length of current character set.
*/
private $charCount = null;
/**
* Scale of the area to swap to a character.
*/
private $scale = null;
/**
* Strategy to calculate luminance.
*/
private $luminanceStrategy = null;
/**
* Constructor which sets default options.
*/
public function __construct()
{
$this->setOptions();
}
/**
* Add a custom character set.
*
* @param string $key for the character set.
* @param string $value for the character set.
*
* @return $this
*/
public function addCharacterSet($key, $value)
{
$this->characterSet[$key] = $value;
return $this;
}
/**
* Set options for processing, defaults are available.
*
* @param array $options to use as default settings.
*
* @return $this
*/
public function setOptions($options = array())
{
$default = array(
"characterSet" => 'two',
"scale" => 14,
"luminanceStrategy" => 3,
"customCharacterSet" => null,
);
$default = array_merge($default, $options);
if (!is_null($default['customCharacterSet'])) {
$this->addCharacterSet('custom', $default['customCharacterSet']);
$default['characterSet'] = 'custom';
}
$this->scale = $default['scale'];
$this->characters = $this->characterSet[$default['characterSet']];
$this->charCount = strlen($this->characters);
$this->luminanceStrategy = $default['luminanceStrategy'];
return $this;
}
/**
* Create an Ascii image from an image file.
*
* @param string $filename of the image to use.
*
* @return string $ascii with the ASCII image.
*/
public function createFromFile($filename)
{
$img = imagecreatefromstring(file_get_contents($filename));
list($width, $height) = getimagesize($filename);
$ascii = null;
$incY = $this->scale;
$incX = $this->scale / 2;
for ($y = 0; $y < $height - 1; $y += $incY) {
for ($x = 0; $x < $width - 1; $x += $incX) {
$toX = min($x + $this->scale / 2, $width - 1);
$toY = min($y + $this->scale, $height - 1);
$luminance = $this->luminanceAreaAverage($img, $x, $y, $toX, $toY);
$ascii .= $this->luminance2character($luminance);
}
$ascii .= PHP_EOL;
}
return $ascii;
}
/**
* Get the luminance from a region of an image using average color value.
*
* @param string $img the image.
* @param integer $x1 the area to get pixels from.
* @param integer $y1 the area to get pixels from.
* @param integer $x2 the area to get pixels from.
* @param integer $y2 the area to get pixels from.
*
* @return integer $luminance with a value between 0 and 100.
*/
public function luminanceAreaAverage($img, $x1, $y1, $x2, $y2)
{
$numPixels = ($x2 - $x1 + 1) * ($y2 - $y1 + 1);
$luminance = 0;
for ($x = $x1; $x <= $x2; $x++) {
for ($y = $y1; $y <= $y2; $y++) {
$rgb = imagecolorat($img, $x, $y);
$red = (($rgb >> 16) & 0xFF);
$green = (($rgb >> 8) & 0xFF);
$blue = ($rgb & 0xFF);
$luminance += $this->getLuminance($red, $green, $blue);
}
}
return $luminance / $numPixels;
}
/**
* Calculate luminance value with different strategies.
*
* @param integer $red The color red.
* @param integer $green The color green.
* @param integer $blue The color blue.
*
* @return float $luminance with a value between 0 and 1.
*/
public function getLuminance($red, $green, $blue)
{
switch ($this->luminanceStrategy) {
case 1:
$luminance = ($red * 0.2126 + $green * 0.7152 + $blue * 0.0722) / 255;
break;
case 2:
$luminance = ($red * 0.299 + $green * 0.587 + $blue * 0.114) / 255;
break;
case 3:
$luminance = sqrt(0.299 * pow($red, 2) + 0.587 * pow($green, 2) + 0.114 * pow($blue, 2)) / 255;
break;
case 0:
default:
$luminance = ($red + $green + $blue) / (255 * 3);
}
return $luminance;
}
/**
* Translate the luminance value to a character.
*
* @param string $position a value between 0-100 representing the
* luminance.
*
* @return string with the ascii character.
*/
public function luminance2character($luminance)
{
$position = (int) round($luminance * ($this->charCount - 1));
$char = $this->characters[$position];
return $char;
}
}

107
CCache.php Normal file
View File

@@ -0,0 +1,107 @@
<?php
/**
* Deal with the cache directory and cached items.
*
*/
class CCache
{
/**
* Path to the cache directory.
*/
private $path;
/**
* Set the path to the cache dir which must exist.
*
* @param string path to the cache dir.
*
* @throws Exception when $path is not a directory.
*
* @return $this
*/
public function setDir($path)
{
if (!is_dir($path)) {
throw new Exception("Cachedir is not a directory.");
}
$this->path = $path;
return $this;
}
/**
* Get the path to the cache subdir and try to create it if its not there.
*
* @param string $subdir name of subdir
* @param array $create default is to try to create the subdir
*
* @return string | boolean as real path to the subdir or
* false if it does not exists
*/
public function getPathToSubdir($subdir, $create = true)
{
$path = realpath($this->path . "/" . $subdir);
if (is_dir($path)) {
return $path;
}
if ($create && is_writable($this->path)) {
$path = $this->path . "/" . $subdir;
if (mkdir($path)) {
return realpath($path);
}
}
return false;
}
/**
* Get status of the cache subdir.
*
* @param string $subdir name of subdir
*
* @return string with status
*/
public function getStatusOfSubdir($subdir)
{
$path = realpath($this->path . "/" . $subdir);
$exists = is_dir($path);
$res = $exists ? "exists" : "does not exist";
if ($exists) {
$res .= is_writable($path) ? ", writable" : ", not writable";
}
return $res;
}
/**
* Remove the cache subdir.
*
* @param string $subdir name of subdir
*
* @return null | boolean true if success else false, null if no operation
*/
public function removeSubdir($subdir)
{
$path = realpath($this->path . "/" . $subdir);
if (is_dir($path)) {
return rmdir($path);
}
return null;
}
}

238
CFastTrackCache.php Normal file
View File

@@ -0,0 +1,238 @@
<?php
/**
* Enable a fast track cache with a json representation of the image delivery.
*
*/
class CFastTrackCache
{
/**
* Cache is disabled to start with.
*/
private $enabled = false;
/**
* Path to the cache directory.
*/
private $path;
/**
* Filename of current cache item.
*/
private $filename;
/**
* Container with items to store as cached item.
*/
private $container;
/**
* Enable or disable cache.
*
* @param boolean $enable set to true to enable, false to disable
*
* @return $this
*/
public function enable($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* Set the path to the cache dir which must exist.
*
* @param string $path to the cache dir.
*
* @throws Exception when $path is not a directory.
*
* @return $this
*/
public function setCacheDir($path)
{
if (!is_dir($path)) {
throw new Exception("Cachedir is not a directory.");
}
$this->path = rtrim($path, "/");
return $this;
}
/**
* Set the filename to store in cache, use the querystring to create that
* filename.
*
* @param array $clear items to clear in $_GET when creating the filename.
*
* @return string as filename created.
*/
public function setFilename($clear)
{
$query = $_GET;
// Remove parts from querystring that should not be part of filename
foreach ($clear as $value) {
unset($query[$value]);
}
arsort($query);
$queryAsString = http_build_query($query);
$this->filename = md5($queryAsString);
if (CIMAGE_DEBUG) {
$this->container["query-string"] = $queryAsString;
}
return $this->filename;
}
/**
* Add header items.
*
* @param string $header add this as header.
*
* @return $this
*/
public function addHeader($header)
{
$this->container["header"][] = $header;
return $this;
}
/**
* Add header items on output, these are not output when 304.
*
* @param string $header add this as header.
*
* @return $this
*/
public function addHeaderOnOutput($header)
{
$this->container["header-output"][] = $header;
return $this;
}
/**
* Set path to source image to.
*
* @param string $source path to source image file.
*
* @return $this
*/
public function setSource($source)
{
$this->container["source"] = $source;
return $this;
}
/**
* Set last modified of source image, use to check for 304.
*
* @param string $lastModified
*
* @return $this
*/
public function setLastModified($lastModified)
{
$this->container["last-modified"] = $lastModified;
return $this;
}
/**
* Get filename of cached item.
*
* @return string as filename.
*/
public function getFilename()
{
return $this->path . "/" . $this->filename;
}
/**
* Write current item to cache.
*
* @return boolean if cache file was written.
*/
public function writeToCache()
{
if (!$this->enabled) {
return false;
}
if (is_dir($this->path) && is_writable($this->path)) {
$filename = $this->getFilename();
return file_put_contents($filename, json_encode($this->container)) !== false;
}
return false;
}
/**
* Output current item from cache, if available.
*
* @return void
*/
public function output()
{
$filename = $this->getFilename();
if (!is_readable($filename)) {
return;
}
$item = json_decode(file_get_contents($filename), true);
if (!is_readable($item["source"])) {
return;
}
foreach ($item["header"] as $value) {
header($value);
}
if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])
&& strtotime($_SERVER["HTTP_IF_MODIFIED_SINCE"]) == $item["last-modified"]) {
header("HTTP/1.0 304 Not Modified");
if (CIMAGE_DEBUG) {
trace(__CLASS__ . " 304");
}
exit;
}
foreach ($item["header-output"] as $value) {
header($value);
}
if (CIMAGE_DEBUG) {
trace(__CLASS__ . " 200");
}
readfile($item["source"]);
exit;
}
}

290
CHttpGet.php Normal file
View File

@@ -0,0 +1,290 @@
<?php
/**
* Get a image from a remote server using HTTP GET and If-Modified-Since.
*
*/
class CHttpGet
{
private $request = array();
private $response = array();
/**
* Constructor
*
*/
public function __construct()
{
$this->request['header'] = array();
}
/**
* Build an encoded url.
*
* @param string $baseUrl This is the original url which will be merged.
* @param string $merge Thse parts should be merged into the baseUrl,
* the format is as parse_url.
*
* @return string $url as the modified url.
*/
public function buildUrl($baseUrl, $merge)
{
$parts = parse_url($baseUrl);
$parts = array_merge($parts, $merge);
$url = $parts['scheme'];
$url .= "://";
$url .= $parts['host'];
$url .= isset($parts['port'])
? ":" . $parts['port']
: "" ;
$url .= $parts['path'];
return $url;
}
/**
* Set the url for the request.
*
* @param string $url
*
* @return $this
*/
public function setUrl($url)
{
$parts = parse_url($url);
$path = "";
if (isset($parts['path'])) {
$pathParts = explode('/', $parts['path']);
unset($pathParts[0]);
foreach ($pathParts as $value) {
$path .= "/" . rawurlencode($value);
}
}
$url = $this->buildUrl($url, array("path" => $path));
$this->request['url'] = $url;
return $this;
}
/**
* Set custom header field for the request.
*
* @param string $field
* @param string $value
*
* @return $this
*/
public function setHeader($field, $value)
{
$this->request['header'][] = "$field: $value";
return $this;
}
/**
* Set header fields for the request.
*
* @param string $field
* @param string $value
*
* @return $this
*/
public function parseHeader()
{
//$header = explode("\r\n", rtrim($this->response['headerRaw'], "\r\n"));
$rawHeaders = rtrim($this->response['headerRaw'], "\r\n");
# Handle multiple responses e.g. with redirections (proxies too)
$headerGroups = explode("\r\n\r\n", $rawHeaders);
# We're only interested in the last one
$header = explode("\r\n", end($headerGroups));
$output = array();
if ('HTTP' === substr($header[0], 0, 4)) {
list($output['version'], $output['status']) = explode(' ', $header[0]);
unset($header[0]);
}
foreach ($header as $entry) {
$pos = strpos($entry, ':');
$output[trim(substr($entry, 0, $pos))] = trim(substr($entry, $pos + 1));
}
$this->response['header'] = $output;
return $this;
}
/**
* Perform the request.
*
* @param boolean $debug set to true to dump headers.
*
* @throws Exception when curl fails to retrieve url.
*
* @return boolean
*/
public function doGet($debug = false)
{
$options = array(
CURLOPT_URL => $this->request['url'],
CURLOPT_HEADER => 1,
CURLOPT_HTTPHEADER => $this->request['header'],
CURLOPT_AUTOREFERER => true,
CURLOPT_RETURNTRANSFER => true,
CURLINFO_HEADER_OUT => $debug,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 5,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 2,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (!$response) {
throw new Exception("Failed retrieving url, details follows: " . curl_error($ch));
}
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$this->response['headerRaw'] = substr($response, 0, $headerSize);
$this->response['body'] = substr($response, $headerSize);
$this->parseHeader();
if ($debug) {
$info = curl_getinfo($ch);
echo "Request header<br><pre>", var_dump($info['request_header']), "</pre>";
echo "Response header (raw)<br><pre>", var_dump($this->response['headerRaw']), "</pre>";
echo "Response header (parsed)<br><pre>", var_dump($this->response['header']), "</pre>";
}
curl_close($ch);
return true;
}
/**
* Get HTTP code of response.
*
* @return integer as HTTP status code or null if not available.
*/
public function getStatus()
{
return isset($this->response['header']['status'])
? (int) $this->response['header']['status']
: null;
}
/**
* Get file modification time of response.
*
* @return int as timestamp.
*/
public function getLastModified()
{
return isset($this->response['header']['Last-Modified'])
? strtotime($this->response['header']['Last-Modified'])
: null;
}
/**
* Get content type.
*
* @return string as the content type or null if not existing or invalid.
*/
public function getContentType()
{
$type = isset($this->response['header']['Content-Type'])
? $this->response['header']['Content-Type']
: null;
return preg_match('#[a-z]+/[a-z]+#', $type)
? $type
: null;
}
/**
* Get file modification time of response.
*
* @param mixed $default as default value (int seconds) if date is
* missing in response header.
*
* @return int as timestamp or $default if Date is missing in
* response header.
*/
public function getDate($default = false)
{
return isset($this->response['header']['Date'])
? strtotime($this->response['header']['Date'])
: $default;
}
/**
* Get max age of cachable item.
*
* @param mixed $default as default value if date is missing in response
* header.
*
* @return int as timestamp or false if not available.
*/
public function getMaxAge($default = false)
{
$cacheControl = isset($this->response['header']['Cache-Control'])
? $this->response['header']['Cache-Control']
: null;
$maxAge = null;
if ($cacheControl) {
// max-age=2592000
$part = explode('=', $cacheControl);
$maxAge = ($part[0] == "max-age")
? (int) $part[1]
: null;
}
if ($maxAge) {
return $maxAge;
}
$expire = isset($this->response['header']['Expires'])
? strtotime($this->response['header']['Expires'])
: null;
return $expire ? $expire : $default;
}
/**
* Get body of response.
*
* @return string as body.
*/
public function getBody()
{
return $this->response['body'];
}
}

2330
CImage.php

File diff suppressed because it is too large Load Diff

315
CRemoteImage.php Normal file
View File

@@ -0,0 +1,315 @@
<?php
/**
* Get a image from a remote server using HTTP GET and If-Modified-Since.
*
*/
class CRemoteImage
{
/**
* Path to cache files.
*/
private $saveFolder = null;
/**
* Use cache or not.
*/
private $useCache = true;
/**
* HTTP object to aid in download file.
*/
private $http;
/**
* Status of the HTTP request.
*/
private $status;
/**
* Defalt age for cached items 60*60*24*7.
*/
private $defaultMaxAge = 604800;
/**
* Url of downloaded item.
*/
private $url;
/**
* Base name of cache file for downloaded item and name of image.
*/
private $fileName;
/**
* Filename for json-file with details of cached item.
*/
private $fileJson;
/**
* Cache details loaded from file.
*/
private $cache;
/**
* Get status of last HTTP request.
*
* @return int as status
*/
public function getStatus()
{
return $this->status;
}
/**
* Get JSON details for cache item.
*
* @return array with json details on cache.
*/
public function getDetails()
{
return $this->cache;
}
/**
* Set the path to the cache directory.
*
* @param boolean $use true to use the cache and false to ignore cache.
*
* @return $this
*/
public function setCache($path)
{
$this->saveFolder = rtrim($path, "/") . "/";
return $this;
}
/**
* Check if cache is writable or throw exception.
*
* @return $this
*
* @throws Exception if cahce folder is not writable.
*/
public function isCacheWritable()
{
if (!is_writable($this->saveFolder)) {
throw new Exception("Cache folder is not writable for downloaded files.");
}
return $this;
}
/**
* Decide if the cache should be used or not before trying to download
* a remote file.
*
* @param boolean $use true to use the cache and false to ignore cache.
*
* @return $this
*/
public function useCache($use = true)
{
$this->useCache = $use;
return $this;
}
/**
* Set header fields.
*
* @return $this
*/
public function setHeaderFields()
{
$cimageVersion = "CImage";
if (defined("CIMAGE_USER_AGENT")) {
$cimageVersion = CIMAGE_USER_AGENT;
}
$this->http->setHeader("User-Agent", "$cimageVersion (PHP/". phpversion() . " cURL)");
$this->http->setHeader("Accept", "image/jpeg,image/png,image/gif");
if ($this->useCache) {
$this->http->setHeader("Cache-Control", "max-age=0");
} else {
$this->http->setHeader("Cache-Control", "no-cache");
$this->http->setHeader("Pragma", "no-cache");
}
}
/**
* Save downloaded resource to cache.
*
* @return string as path to saved file or false if not saved.
*/
public function save()
{
$this->cache = array();
$date = $this->http->getDate(time());
$maxAge = $this->http->getMaxAge($this->defaultMaxAge);
$lastModified = $this->http->getLastModified();
$type = $this->http->getContentType();
$this->cache['Date'] = gmdate("D, d M Y H:i:s T", $date);
$this->cache['Max-Age'] = $maxAge;
$this->cache['Content-Type'] = $type;
$this->cache['Url'] = $this->url;
if ($lastModified) {
$this->cache['Last-Modified'] = gmdate("D, d M Y H:i:s T", $lastModified);
}
// Save only if body is a valid image
$body = $this->http->getBody();
$img = imagecreatefromstring($body);
if ($img !== false) {
file_put_contents($this->fileName, $body);
file_put_contents($this->fileJson, json_encode($this->cache));
return $this->fileName;
}
return false;
}
/**
* Got a 304 and updates cache with new age.
*
* @return string as path to cached file.
*/
public function updateCacheDetails()
{
$date = $this->http->getDate(time());
$maxAge = $this->http->getMaxAge($this->defaultMaxAge);
$lastModified = $this->http->getLastModified();
$this->cache['Date'] = gmdate("D, d M Y H:i:s T", $date);
$this->cache['Max-Age'] = $maxAge;
if ($lastModified) {
$this->cache['Last-Modified'] = gmdate("D, d M Y H:i:s T", $lastModified);
}
file_put_contents($this->fileJson, json_encode($this->cache));
return $this->fileName;
}
/**
* Download a remote file and keep a cache of downloaded files.
*
* @param string $url a remote url.
*
* @throws Exception when status code does not match 200 or 304.
*
* @return string as path to downloaded file or false if failed.
*/
public function download($url)
{
$this->http = new CHttpGet();
$this->url = $url;
// First check if the cache is valid and can be used
$this->loadCacheDetails();
if ($this->useCache) {
$src = $this->getCachedSource();
if ($src) {
$this->status = 1;
return $src;
}
}
// Do a HTTP request to download item
$this->setHeaderFields();
$this->http->setUrl($this->url);
$this->http->doGet();
$this->status = $this->http->getStatus();
if ($this->status === 200) {
$this->isCacheWritable();
return $this->save();
} elseif ($this->status === 304) {
$this->isCacheWritable();
return $this->updateCacheDetails();
}
throw new Exception("Unknown statuscode when downloading remote image: " . $this->status);
}
/**
* Get the path to the cached image file if the cache is valid.
*
* @return $this
*/
public function loadCacheDetails()
{
$cacheFile = md5($this->url);
$this->fileName = $this->saveFolder . $cacheFile;
$this->fileJson = $this->fileName . ".json";
if (is_readable($this->fileJson)) {
$this->cache = json_decode(file_get_contents($this->fileJson), true);
}
}
/**
* Get the path to the cached image file if the cache is valid.
*
* @return string as the path ot the image file or false if no cache.
*/
public function getCachedSource()
{
$imageExists = is_readable($this->fileName);
// Is cache valid?
$date = strtotime($this->cache['Date']);
$maxAge = $this->cache['Max-Age'];
$now = time();
if ($imageExists && $date + $maxAge > $now) {
return $this->fileName;
}
// Prepare for a 304 if available
if ($imageExists && isset($this->cache['Last-Modified'])) {
$this->http->setHeader("If-Modified-Since", $this->cache['Last-Modified']);
}
return false;
}
}

62
CWhitelist.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
/**
* Act as whitelist (or blacklist).
*
*/
class CWhitelist
{
/**
* Array to contain the whitelist options.
*/
private $whitelist = array();
/**
* Set the whitelist from an array of strings, each item in the
* whitelist should be a regexp without the surrounding / or #.
*
* @param array $whitelist with all valid options,
* default is to clear the whitelist.
*
* @return $this
*/
public function set($whitelist = array())
{
if (!is_array($whitelist)) {
throw new Exception("Whitelist is not of a supported format.");
}
$this->whitelist = $whitelist;
return $this;
}
/**
* Check if item exists in the whitelist.
*
* @param string $item string to check.
* @param array $whitelist optional with all valid options, default is null.
*
* @return boolean true if item is in whitelist, else false.
*/
public function check($item, $whitelist = null)
{
if ($whitelist !== null) {
$this->set($whitelist);
}
if (empty($item) or empty($this->whitelist)) {
return false;
}
foreach ($this->whitelist as $regexp) {
if (preg_match("#$regexp#", $item)) {
return true;
}
}
return false;
}
}

View File

@@ -1,2 +1,21 @@
This is a software solution to a general known problem.
Free software. Use at own risk.
The MIT License (MIT)
Copyright (c) 2012 - 2016 Mikael Roos, https://mikaelroos.se, mos@dbwebb.se
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

616
README.md
View File

@@ -1,37 +1,62 @@
Image conversion on the fly using PHP
=====================================
[![Join the chat at https://gitter.im/mosbth/cimage](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mosbth/cimage?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/mosbth/cimage.svg?branch=master)](https://travis-ci.org/mosbth/cimage)
[![Build Status](https://scrutinizer-ci.com/g/mosbth/cimage/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
About
-------------------------------------
`CImage` is a PHP class which enables resizing of images through scaling and cropping together with filtering effects, all using PHP GD. The script `img.php` uses `CImage` to enable server-side image processing together with caching and optimization of the processed images.
<img src="https://cimage.se/cimage/imgd.php?src=example/kodim07.png&w=200&c=140,140,520,340&sharpen"/>
Server-side image processing is a most useful tool for any web developer, `img.php` has an easy to use interface and its quite powerful when you integrate it with your website. Using it might decrease the time and effort put in managing images and improve your work flow when creating content for websites.
`CImage` is a PHP class enabling resizing of images through scaling, cropping and filtering effects -- using PHP GD. The script `img.php` uses `CImage` to enable server-side image processing utilizing caching and optimization of the processed images.
Read more on http://dbwebb.se/opensource/cimage
Server-side image processing is a most useful tool for any web developer, `img.php` has an easy to use interface and its powerful when you integrate it with your website. Using it might decrease the time and effort for managing images and it might improve your workflow for creating content for websites.
Enjoy!
Mikael Roos (me@mikaelroos.se)
This software is free and open source, licensed according MIT.
License
-------------------------------------
Documentation
--------------------------------------
This is free software and open source software, licensed according MIT.
Read full documentation at:
<strike>http://dbwebb.se/opensource/cimage</strike>
New website is being setup at [cimage.se](https://cimage.se), to improve documentation (work is ongoing).
Installation and get going
-------------------------------------
**Latest stable version is v0.5 released 2014-02-12.**
Requirements
--------------------------------------
`CImage` and `img.php` supports GIF (with transparency), JPEG and PNG (8bit transparent, 24bit semi transparent) images. It requires PHP 5.3 and PHP GD. You optionally need the EXIF extension to support auto-rotation of JPEG-images.
*Version v0.7.x will be the last version to support PHP 5.3. Coming version will require newer version of PHP.*
Installation
--------------------------------------
There are several ways of installing. You either install the whole project which uses the autoloader to include the various files, or you install the all-included bundle that -- for convenience -- contains all code in one script.
###Install source from GitHub
The [sourcode is available on GitHub](https://github.com/mosbth/cimage). Clone, fork or [download as zip](https://github.com/mosbth/cimage/archive/master.zip).
**Latest stable version is v0.7.15 released 2016-08-08.**
I prefer cloning like this. Do switch to the latest stable version.
```bash
git clone git://github.com/mosbth/cimage.git
cd cimage
git checkout v0.5
git checkout v0.7.15
```
Make the cache-directory writable by the webserver.
@@ -40,30 +65,199 @@ Make the cache-directory writable by the webserver.
chmod 777 cache
```
Try it out by pointing your browser to the test file `webroot/test.php`.
###Install all-included bundle
There are some all-included bundles of `img.php` that can be downloaded and used without dependency to the rest of the sourcecode.
| Scriptname | Description |
|------------|-------------|
| `imgd.php` | Development mode with verbose error reporting and option `&verbose` enabled. |
| `imgp.php` | Production mode logs all errors to file, giving server error 500 for bad usage, option `&verbose` disabled. |
| `imgs.php` | Strict mode logs few errors to file, giving server error 500 for bad usage, option `&verbose` disabled. |
Dowload the version of your choice like this.
```bash
wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.15/webroot/imgp.php
```
Open up the file in your editor and edit the array `$config`. Ensure that the paths to the image directory and the cache directory matches your environment, or create an own config-file for the script.
###Install from Packagist
You can install the package [`mos/cimage` from Packagist](https://packagist.org/packages/mos/cimage) using composer.
Use cases
--------------------------------------
Lets take some use cases to let you know when and how `img.php` might be useful.
### Make a thumbnail
<img src="https://cimage.se/cimage/imgd.php?src=example/kodim04.png&w=80&h=80&cf">
Lets say you have a larger image and you want to make a smaller thumbnail of it with a size of 80x80 pixels. You simply take the image and add constraints on `width`, `height` and you use the resize strategy `crop-to-fit` to crops out the parts of the image that does not fit.
To produce such a thumbnail, create a link like this:
> `img.php?src=kodim04.png&width=80&height=80&crop-to-fit`
### Slightly complexer use case
Perhaps you got an image from a friend. The image was taken with the iPhone and thus rotated.
<img src="https://cimage.se/cimage/imgd.php?src=example/issue36/me-270.jpg&w=250">
The original image is looking like this one, scaled down to a width of 250 pixels.
So, you need to rotate it and crop off some parts to make it intresting.
To show it off, I'll auto-rotate the image based on its EXIF-information, I will crop it to a thumbnail of 100x100 pixels and add a filter to make it greyscale finishing up with a sharpen effect. Just for the show I'll rotate the image 25 degrees - do not ask me why.
Lets call this *the URL-Photoshopper*. This is how the magic looks like.
> `img.php?src=issue36/me-270.jpg&w=100&h=100&cf&aro`
> `&rb=-25&a=8,30,30,38&f=grayscale&convolve=sharpen-alt`
<img src="https://cimage.se/cimage/imgd.php?src=example/issue36/me-270.jpg&w=100&h=100&cf&aro&rb=-25&a=8,30,30,38&f=grayscale&convolve=sharpen-alt">
For myself, I use `img.php` to put up all images on my website, it gives me the power of affecting the resulting images - without opening up a photo-editing application.
Get going quickly
--------------------------------------
###Check out the test page
Try it out by pointing your browser to the test file `webroot/test/test.php`. It will show some example images and you can review how they are created.
###Process your first image
<img src="https://cimage.se/cimage/imgd.php?src=example/kodim04.png&amp;w=w2&amp;a=40,0,50,0" alt=''>
Try it yourself by opening up an image in your browser. Start with
> `webroot/img.php?src=kodim04.png`
and try to resize it to a thumbnail by adding the options
> `&width=100&height=100&crop-to-fit`
###What does "processing the image" involves?
Add `&verbose` to the link to get a verbose output of what is happens during image processing. This is useful for developers and those who seek a deeper understanding on how it works behind the scene.
###Check your system
Open up `webroot/check_system.php` if you are uncertain that your system has the right extensions loaded.
###How does it work?
Review the settings in `webroot/img_config.php` and check out `webroot/img.php` on how it uses `CImage`.
The programatic flow, just to get you oriented in the environment, is.
1. Start in `img.php`.
2. `img.php` reads configuration details from `img_config.php` (if the config-file is available).
3. `img.php` reads and processes incoming `$_GET` arguments to prepare using `CImage`.
4. `img.php` uses `CImage`.
5. `CImage` processes, caches and outputs the image according to how its used.
Read on to learn more on how to use `img.php`.
Usage
-------------------------------------
Basic usage
--------------------------------------
###List of parameters {#parameters}
The `img.php` supports a lot of parameters. Combine the parameters to get the desired behavior and resulting image. For example, take the original image, resize it using width, aspect-ratio and crop-to-fit, apply a sharpen effect, save the image as JPEG using quality 30.
| `img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30` |
|-----------------------------------------------------------|
| <img src=/kod-exempel/cimage_/webroot/img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30 alt=''> |
###Select the source
Open an image through `img.php` by using its `src` attribute.
> `img.php?src=kodim13.png`
It looks like this.
<img src="https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=w1&save-as=jpg">
All images are stored in a directory structure and you access them as:
> `?src=dir1/dir2/image.png`
###Resize using constraints on width and height
Create a thumbnail of the image by applying constraints on width and height, or one of them.
| `&width=150` | `&height=150` | `&w=150&h=150` |
|---------------------|---------------------|---------------------|
| <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=150 alt=''> | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&h=150 alt=''> | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=150&h=150 alt=''> |
By setting `width`, `height` or both, the image gets resized to be *not larger* than the defined dimensions *and* keeping its original aspect ratio.
Think of the constraints as a imaginary box where the image should fit. With `width=150` and `height=150` the box would have the dimension of 150x150px. A landscape image would fit in that box and its width would be 150px and its height depending on the aspect ratio, but for sure less than 150px. A portrait image would fit with a height of 150px and the width depending on the aspect ratio, but surely less than 150px.
###Resize to fit a certain dimension
Creating a thumbnail with a certain dimension of width and height, usually involves stretching or cropping the image to fit in the selected dimensions. Here is how you create a image that has the exact dimensions of 300x150 pixels, by either *stretching*, *cropping* or *fill to fit*.
| What | The image |
|---------------------|---------------------|
| **Original.** The original image resized with a max width and max height.<br>`?w=300&h=150` | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=300&h=150 alt=''> |
| **Stretch.** Stretch the image so that the resulting image has the defined width and height.<br>`?w=300&h=150&stretch` | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=300&h=150&stretch alt=''> |
| **Crop to fit.** Keep the aspect ratio and crop out the parts of the image that does not fit.<br>`?w=300&h=150&crop-to-fit` | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=300&h=150&crop-to-fit alt=''> |
| **Fill to fit.** Keep the aspect ratio and fill then blank space with a background color.<br>`?w=300&h=150&fill-to-fit=006600` | <img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=300&h=150&fill-to-fit=006600 alt=''> |
Learn to crop your images, creative cropping can make wonderful images from appearingly useless originals.
Stretching might work, like in the above example where you can not really notice that the image is stretched. But usually, stretching is not that a good option since it distorts the ratio. Stretching a face may not turn out particularly well.
Fill to fit is useful when you have some image that must fit in a certain dimension and stretching nor cropping can do it. Carefully choose the background color to make a good resulting image. Choose the same background color as your website and no one will notice.
###List of parameters
`img.php` supports a lot of parameters. Combine the parameters to get the desired behavior and resulting image. For example, take the original image, resize it using width, aspect-ratio and crop-to-fit, apply a sharpen effect, save the image as JPEG using quality 30.
> `img.php?src=kodim13.png&w=600&aspect-ratio=4`
> `&crop-to-fit&sharpen&save-as=jpg&q=30`
<img src=https://cimage.se/cimage/imgd.php?src=example/kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30 alt=''>
Here is a list of all parameters that you can use together with `img.php`, grouped by its basic intent of usage.
####Mandatory options and debugging
####Mandatory options and debugging
The `src` is the only mandatory option. The other in this section is useful for debugging or deciding what version of the target image is used.
Option `src` is the only mandatory option. The options in this section is useful for debugging or deciding what version of the target image is used.
| Parameter | Explained |
|----------------|----------------------------------------------|
@@ -71,49 +265,89 @@ The `src` is the only mandatory option. The other in this section is useful for
| `nc, no-cache` | Do not use the cached version, do all image processing and save a new image to cache. |
| `so, skip-original`| Skip using the original image, always process image, create and use a cached version of the original image. |
| `v, verbose` | Do verbose output and print out a log what happens. Good for debugging, analyzing the process and inspecting how the image is being processed. |
| `json` | Output a JSON-representation of the image, useful for testing or optimizing when one wants to know the image dimensions, before using it. |
| `pwd, password` | Use password to protect unauthorized usage. |
####Options for resizing image
####Options for deciding width and height of target image
These options are all affecting the dimensions used when resizing the image. Its used to define the area to use in the source image and the resulting dimensions for the target image.
These options are all affecting the final dimensions, width and height, of the resulting image.
| Parameter | Explained |
|----------------|----------------------------------------------|
| `h, height` | `h=200` sets the width to be to max 200px. `h=25%` sets the height to max 25% of its original height. |
| `w, width` | `w=200` sets the height to be max 200px. `w=100%` sets the width to max 100% of its original width. |
| `ar, aspect-ratio` | Control target aspect ratio. Use together with either height or width or alone to base calculations on original image dimensions. This setting is used to calculate the resulting dimension for the image. `w=160&aspect-ratio=1.6` results in a height of 100px. Use ar=!1.6 to inverse the ratio, useful when using portrat instead of landscape images. |
| `ar, aspect-ratio` | Control target aspect ratio. Use together with either height or width or alone to base calculations on original image dimensions. This setting is used to calculate the resulting dimension for the image. `w=160&aspect-ratio=1.6` results in a height of 100px. Use `ar=!1.6` to inverse the ratio, useful for portrait images, compared to landscape images. |
| `dpr, device-pixel-ratio` | Default value is 1, set to 2 when you are delivering the image to a high density screen, `dpr=2` or `dpr=1.4`. Its a easy way to say the image should have larger dimensions. The resulting image will be twice as large (or 1.4 times), keeping its aspect ratio. |
####Options for resize strategy
These options affect strategy to use when resizing an image into a target image that has both width and height set.
| Parameter | Explained |
|----------------|----------------------------------------------|
| `nr, no-ratio, stretch` | Do *not* keep aspect ratio when resizing and using both width & height constraints. Results in stretching the image, if needed, to fit in the resulting box. |
| `cf, crop-to-fit` | Set together with both `h` & `w` to make the image fit into dimensions, and crop out the rest of the image. |
| `a, area` | Define the area of the image to work with. Set `area=10,10,10,10` (top,right,bottom,left) to crop out the 10% of the outermost area. It works like an offset to define which part of the image you want to process. Its an alternative of using `crop`. |
| `c, crop` | Crops an area from the original image, set width, height, start_x and start_y to define the area to crop, for example `crop=100,100,10,10` (`crop=width,height,start_x,start_y`). Left top corner is 0, 0. You can use `left`, `right` or `center` when setting start_x. You may use `top`, `bottom` or `center` when setting start_y. |
| `cf, crop-to-fit` | Set together with both `h` and `w` to make the image fit into dimensions, and crop out the rest of the image. |
| `ff, fill-to-fit` | Set together with both `h` and `w` to make the image fit into dimensions, and fill the rest using a background color. You can optionally supply a background color as this `ff=00ff00`, or `ff=00ff007f` when using the alpha channel. |
| `nu, no-upscale` | Avoid smaller images from being upscaled to larger ones. Combine with `stretch`, `crop-to-fit` or `fill-to-fit` to get the smaller image centered on a larger canvas. The requested dimension for the target image are thereby met. |
####Processing of image before resizing
####Options for cropping part of image
These options are executed *before* the image is resized.
These options enable to decide what part of image to crop out.
| Parameter | Explained |
|----------------|----------------------------------------------|
| `c, crop` | Crops an area from the original image, set `width`, `height`, `start_x` and `start_y` to define the area to crop, for example `crop=100,100,10,10` (`crop=width,height,start_x,start_y`). Left top corner is 0, 0. You can use `left`, `right` or `center` when setting `start_x`. You may use `top`, `bottom` or `center` when setting `start_y`. |
| `a, area` | Define the area of the image to work with. Set `area=10,10,10,10` (`top`, `right`, `bottom`, `left`) to crop out the 10% of the outermost area. It works like an offset to define the part of the image you want to process. Its an alternative of using `crop`. |
####General processing options
These options are general options affecting processing.
| Parameter | Explained |
|----------------|----------------------------------------------|
| `bgc, bg-color` | Set the backgroundcolor to use (if its needed). Use six hex digits as `bgc=00ff00` and 8 digits when using the alpha channel, as this `bgc=00ff007f`. The alpha value can be between 00 and 7f. |
####Processing of image before resizing
This option are executed *before* the image is resized.
| Parameter | Explained |
|----------------|----------------------------------------------|
| `s, scale` | Scale the image to a size proportional to a percentage of its original size, `scale=25` makes an image 25% of its original size and `size=200` doubles up the image size. Scale is applied before resizing and has no impact of the target width and height. |
| `rb, rotate-before` | Rotate the image before its processed, send the angle as parameter `rb=45`. |
| `aro, auto-rotate` | Auto rotate the image based on EXIF information (useful when using images from smartphones). |
####Processing of image after resizing
####Processing of image after resizing
These options are executed *after* the image is resized.
| Parameter | Explained |
| Parameter | Explained |
|----------------|----------------------------------------------|
| `sharpen` | Appy a filter that sharpens the image. |
| `emboss` | Appy a filter with an emboss effect. |
| `blur` | Appy a filter with a blur effect. |
| `f, filter` | Apply filter to image, `f=colorize,0,255,0,0` makes image more green. Supports all filters as defined in [PHP GD `imagefilter()`](http://php.net/manual/en/function.imagefilter.php). |
| `ra, rotate-after`<br>`r, rotate` | Rotate the image after its processed, send the angle as parameter `ra=45`. |
| `sharpen` | Appy a convolution filter that sharpens the image. |
| `emboss` | Appy a convolution filter with an emboss effect. |
| `blur` | Appy a convolution filter with a blur effect. |
| `convolve` | Appy custom convolution filter as a 3x3 matrix, a divisor and offset, `convolve=0,-1,0,-1,5,-1,0,-1,0,1,0` sharpens the image. |
| `convolve` | Use predefined convolution expression as `convolve=sharpen-alt` or a serie of convolutions as `convolve=draw,mean,motion`. These are supported out of the box: `lighten`, `darken`, `sharpen`, `sharpen-alt`, `emboss`, `emboss-alt`, `blur`, `gblur`, `edge`, `edge-alt`, `draw`, `mean`, `motion`. Add your own, or overwrite existing, in `img_config.php`. |
| `f, filter` | Apply filter to image, `f=colorize,0,255,0,0` makes image more green. Supports all filters as defined in [PHP GD `imagefilter()`](http://php.net/manual/en/function.imagefilter.php). |
| `f0, f1-f9` | Same as `filter`, just add more filters. Applied in order `f`, `f0-f9`. |
| `sc, shortcut` | Save longer expressions in `img_config.php`. One place to change your favorite processing options, use as `sc=sepia` which is a shortcut for `&f=grayscale&f0=brightness,-10&f1=contrast,-20`<br>`&f2=colorize,120,60,0,0&sharpen`. |
####Saving image, affecting quality and filesize
####Saving image, affecting quality and file size
Options for saving the target image.
@@ -123,89 +357,273 @@ Options for saving the target image.
| `co, compress` | For PNG images it defines the compression algorithm, values can be 0-9, default is defined by PHP GD. Compress only affects PNG. |
| `p, palette` | Create a palette version of the image with up to 256 colors. |
| `sa, save-as` | Save resulting image as JPEG, PNG or GIF, for example `?src=river.png&save-as=gif`. |
| `alias` | Save resulting image as a copy in the alias-directory. |
Carry on reading to view examples on how to use and combine the parameters to achieve desired effects and target images.
The configuration settings in `_config.php`
--------------------------------------
There are several configurations settings that can be used to change the behaviour of `img.php`. Here is an overview, listed as they appear in the default config-file.
| Setting | Explained |
|-------------------------|----------------------------------------------|
| `mode` | Set to "development", "production" or "strict" to match the mode of your environment. It mainly affects the error reporting and if option `verbose` is enabled or not. |
| `autoloader` | Path to the file containing the autoloader. |
| `image_path` | Path to the directory-structure containing the images. |
| `cache_path` | Path to the directory where all the cache-files are stored. |
| `alias_path` | Path to where the alias, or copy, of the images are stored. |
| `password` | Set the password to use. |
| `password_always` | Always require the use of password and match with `password`. |
| `remote_allow` | Allow remote download of images when `src=http://example.com/img.jpg`. |
| `remote_pattern` | Pattern (regexp) to detect if a file is remote or not. |
| `valid_filename` | A regular expression to test if a `src` filename is valid or not. |
| `valid_aliasname` | A regular expression to test if a `alias` filename is valid or not. | |
| `img_path_constraint` | Check that the target image is in a true subdirectory of `img-path` (disables symbolic linking to another part of the filesystem. |
| `default_timezone` | Use to set the timezone if its not already set. |
| `max_width` | Maximal width of the target image. Fails for larger values. |
| `max_height` | Maximal height of the target image. Fails for larger values. |
| `background_color` | Specify a default background color and overwrite the one proposed by `CImage`. |
| `png_filter` | Use (or not) an external command for filter PNG images. |
| `png_filter_cmd` | Path and options to the actual external command. |
| `png_deflate` | Use (or not) an external command for deflating PNG images. |
| `png_deflate_cmd` | Path and options to the actual external command. |
| `jpeg_optimize` | Use (or not) an external command for optimizing JPEG images. |
| `jpeg_optimize_cmd` | Path and options to the actual external command. |
| `convolution_constant` | Constants for own defined convolution expressions. |
| `allow_hotlinking` | Allow or disallow hotlinking7leeching of images. |
| `hotlinking_whitelist` | Array of regular expressions that allow hotlinking (if hotlinking is disabled). |
| `shortcut` | Define own shortcuts for more advanced combination of options to `img.php`. |
| `size_constant` | Create an array with constant values to be used instead of `width` and `height`. |
| `aspect_ratio_constant` | Create an array for constant values to be used with option 'aspect-ratio`. |
Consult the file `webroot/img-config.php` for a complete list together with the default values for each configuration setting. There is an [appendix where you can see the default config-file](#img-config).
###Create and name the config file
The file `img.php` looks for the config-file `img_config.php`, and uses it if its found. The three files where everything is included -- `imgd.php`, `imgp.php` and `imgs.php` -- includes an empty `$config`-array which can be overridden by saving a config-file in the same directory. If the script is `imgp.php` then name the config-file `imgp_config.php` and it will find it and use those settings.
Debugging image processing
--------------------------------------
You can visualize what happens during image processing by adding the `v, verbose` parameter. It will then display the resulting image together with a verbose output on what is actually happening behind the scene.
<img src="http://dbwebb.se/image/snapshot/CImage_verbose_output.jpg?w=w2&q=60&sharpen">
This can be most useful for debugging and to understand what actually happen.
The parameter `nc, no-cache` ignores the cached item and will always create a new cached item.
The parameter `so, skip-original` skips the original image, even it that is a best fit. As a result a cached image is created and displayed.
A JSON representation of the image
--------------------------------------
You can ge a JSON representation of the image by adding the option `json`. This can be useful if you need to know the actual dimension of the image.
For example, the following image is created like this:
> `&w=300&save-as=jpg`
<img src="https://cimage.se/cimage/imgd.php?src=example/kodim24.png&w=300&save-as=jpg" alt=''>
Its JSON-representation is retrieved like this:
> `&w=300&save-as=jpg&json`
Which gives the following result.
```php
{
"src":"kodim24.png",
"srcGmdate":"Wed, 12 Feb 2014 13:46:19",
"cache":"_._kodim24_300_200_q60.jpg",
"cacheGmdate":"Sat, 06 Dec 2014 14:09:50",
"filename":"_._kodim24_300_200_q60.jpg",
"width":300,
"height":200,
"aspectRatio":1.5,
"size":11008,
"colors":25751
}
```
I'll use this feature for ease testing of `img.php` and `CImage`. But the feature can also be useful when one really want complete control over the resulting dimension of an image.
Revision history
-------------------------------------
Implications and considerations
--------------------------------------
Here are some thoughts when applying `img.php` on a live system.
v0.5 (2014-02-07)
* Change constant name `CImage::PNG_QUALITY_DEFAULT` to `CImage::PNG_COMPRESSION_DEFAULT`.
* Split JPEG quality and PNG compression, `CImage->quality` and `CImage->compression`
* Changed `img.php` parameter name `d, deflate` to `co, compress`.
* Separating configuration issues from `img.php` to `img_config.php`.
* Format code according to PSR-2.
* Disabled post-processing JPEG and PNG as default.
* This version is supporting PHP 5.3, later versions will require 5.5 or later.
* Using GitHub issue tracking for feature requests and planning.
* Rewrote [the manual](http://dbwebb.se/opensource/cimage).
* Created directory `webroot` and moved some files there.
###Select the proper mode
Select the proper mode for `img.php`. Set it to "strict" or "production" to prevent outsiders to get information about your system. Use only "development" for internal use since its quite verbose in its nature of error reporting.
v0.4.1 (2014-01-27)
* Changed => to == on Modified-Since.
* Always send Last-Modified-Header.
* Added `htmlentities()` to verbose output.
* Fixed support for jpeg, not only jpg.
* Fixed crop whole image by setting crop=0,0,0,0
* Use negative values for crop width & height to base calulation on original width/height and withdraw selected amount.
* Correcting jpeg when setting quality.
* Removed obsolete reference to `$newName` in `CImage::__construct()` (issue 1).
###Put the installation directory outside web root
Edit the config file to put the installation directory -- and the cache directory -- outside of the web root. Best practice would be to store the installation directory and cache, outside of the web root. The only thing needed in the web root is `img.php` and `img_config.php` (if used) which can be placed, for example, in `/img/img.php` or just as `/img.php`.
v0.4 (2013-10-08)
* Improved support for pre-defined sizes.
* Adding grid column size as predefined size, c1-c24 for a 24 column grid. Configure in `img.php`.
* Corrected error on naming cache-files using subdir.
* Corrected calculation error on width & height for crop-to-fit.
* Adding effects for sharpen, emboss and blur through imageconvolution using matrixes.
* crop-to-fit, add parameter for offset x and y to enable to define which area is the, implemented as area.
* Support for resizing opaque images.
* Center of the image from which the crop is done. Improved usage of area to crop.
* Added support for % in width & height.
* Added aspect-ratio.
* Added scale.
* Quality for PNG images is now knows as deflate.
* Added palette to create images with max 256 colors.
* Added usage of all parameters to README.md
* Added documentation here http://dbwebb.se/opensource/cimage
* Adding `.gitignore`
* Re-adding `cache` directory
###Friendly urls through `.htaccess`
Use `.htaccess`and rewrite rules (Apache) to get friendly image urls. Put `img.php` in the `/img` directory. Put the file `.htaccess` in the web root.
**.htaccess for `img.php`.**
```php
#
# Rewrite to have friendly urls to img.php, edit it to suite your environment.
#
# The example is set up as following.
#
# img A directory where all images are stored
# img/me.jpg Access a image as usually.
# img/img.php This is where I choose to place img.php (and img_config.php).
# image/me.jpg Access a image though img.php using htaccess rewrite.
# image/me.jpg?w=300 Using options to img.php.
#
# Subdirectories also work.
# img/me/me.jpg Direct access to the image.
# image/me/me.jpg Accessed through img.php.
# image/me/me.jpg?w=300 Using options to img.php.
#
RewriteRule ^image/(.*)$ img/img.php?src=$1 [QSA,NC,L]
```
You can now access all images through either `/image/car.jpg` (which uses `img.php`) or as usual through `/img/car.jpg` without passing through `img.php`. You send the arguments as usual.
> `/image/car.jpg?w=300&sharpen`
Or a image that resides in a subdirectory.
> `/image/all-cars/car.jpg?w=300&sharpen`
The result is good readable urls to your images. Its easy for the search engine to track and you can use the directory structure already existing in `/img`. Just like one wants to have it.
v0.3 (2012-10-02)
* Added crop. Can crop a area (`width`, `height`, `start_x`, `start_y`) from the original
image.
* Corrected to make the 304 Not Modified header work.
* Predefined sizes can be configured for width in `img.php`.
* Corrected to make crop work with width or height in combination with crop-to-fit.
###Monitor cache size
v0.2 (2012-05-09)
There is a utility `cache.bash` included for monitoring the size of the cache-directory. It generates an output like this.
* Implemented filters as in http://php.net/manual/en/function.imagefilter.php
* Changed `crop` to `crop_to_fit`, works the same way.
* Changed arguments and sends them in array.
* Added quality-setting.
* Added testcases for above.
```bash
$ ./cache.bash
Usage: ./cache.bash [cache-dir]
$ ./cache.bash cache
Total size: 27M
Number of files: 225
Top-5 largest files:
1032 cache/_._kodim08_768_512_q60convolvesharpen.png
960 cache/_._kodim08_768_512_q60convolveemboss.png
932 cache/_._kodim08_768_512_q60_rb45.png
932 cache/_._kodim08_768_512_q60_ra45.png
856 cache/_._kodim08_768_512_q60_rb90.png
Last-5 created files:
2014-11-26 16:51 cache/_._kodim08_768_512_q60convolvelighten.png
2014-11-26 16:51 cache/_._kodim08_768_512_q60convolveblur.png
2014-11-26 16:48 cache/_._kodim08_400_267_q60convolvesharpen.png
2014-11-26 16:48 cache/_._kodim08_400_267_q60convolvelighten.png
2014-11-26 16:48 cache/_._kodim08_400_267_q60convolveemboss.png
Last-5 accessed files:
2014-11-27 16:12 _._wider_900_581_q60.jpg
2014-11-27 16:12 _._wider_750_484_q60.jpg
2014-11-27 16:12 _._wider_640_413_q60.jpg
2014-11-27 16:12 _._wider_640_200_c640-200-0-100_q60.jpg
2014-11-27 16:12 _._wider_600_387_q60.jpg
```
Use it as a base if you feel the need to monitor the size och the cache-directory.
v0.1.1 (2012-04-27)
* Corrected calculation where both width and height were set.
###Read-only cache
The cache directory need to be writable for `img.php` to create new files. But its possible to first create all cache-files and then set the directory to be read-only. This will give you a way of shutting of `img.php` from creating new cache files. `img.php` will then continue to work for all images having a cached version but will fail if someone tries to create a new, not previously cached, version of the image.
v0.1 (2012-04-25)
* Initial release after rewriting some older code doing the same, but not that good and flexible.
###Post-processing with external tools
<pre>
.
..: Copyright 2012-2014 by Mikael Roos (me@mikaelroos.se)
</pre>
You can use external tools to post-process the images to optimize the file size. This option is available for JPEG and for PNG images. Post-processing is disabled by default, edit `img_config.php` to enable it.
It takes additional time to do post processing, it can take up to a couple of seconds. This is processing to create the cached image, thereafter the cached version will be used and no more post processing needs to be done.
These tools for post processing is not a part of `CImage` and `img.php`, you need to download and install them separately. I use them myself on my system to get an optimal file size.
###Allowing remote download of images
You can allow `img.php` to download remote images. That can be enabled in the config-file. However, before doing so, consider the implications on allowing anyone to download a file, hopefully an image, to your server and then the possibility to access it through the webserver.
That sounds scary. It should.
For my own sake I will use it like this, since I consider it a most useful feature.
* Create a special version of `img.php` that has remote download allowed, hide it from public usage.
* Always use a password.
* Download and process the image and save it as an `alias`.
* Integrate the image into your webpage and use the image in the alias directory.
This is an easy way to quickly download a remote image, process and share it.
So, its a scary feature and I might regret I did put it in. Still, its disabled by default and you enable it on your own risk. I have tried to make it as secure as I can, but I might have missed something. I will run it on my own system so I guess I'll find out how secure it is.
Community
--------------------------------------
There is a Swedish forum where you can ask questions, even in English. The forum is a general forum for education in web development, it is not specific for this software.
Ask questions on `CImage` and `img.php` [in the PHP sub forum]([BASEURL]forum/viewforum.php?f=12).
Or ask it on GitHub by creating an issue -- that would be the best place to ask questions.
Or if you fancy irc.
* `irc://irc.bsnet.se/#db-o-webb`
* `irc://irc.freenode.net/#dbwebb`
Trouble- and feature requests
--------------------------------------
Use [GitHub to report issues](https://github.com/mosbth/cimage/issues). Always include the following.
1. Describe very shortly: What are you trying to achieve, what happens, what did you expect.
2. Parameter list used for `img.php`.
3. The image used.
If you request a feature, describe its usage and argument for why you think it fits into `CImage` and `img.php`.
Feel free to fork, clone and create pull requests.
```
.
..: Copyright 2012-2015 by Mikael Roos (me@mikaelroos.se)
```

333
REVISION.md Normal file
View File

@@ -0,0 +1,333 @@
Revision history
=====================================
[![Build Status](https://travis-ci.org/mosbth/cimage.svg?branch=master)](https://travis-ci.org/mosbth/cimage)
[![Build Status](https://scrutinizer-ci.com/g/mosbth/cimage/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
v0.7.15 (2016-08-08)
-------------------------------------
* Added the [Lenna/Lena sample image](http://www.cs.cmu.edu/~chuck/lennapg/) as tif and created a png, jpeg and webp version using Imagick convert `convert lena.tif lena.{png,jpg,webp}`, #152.
* Limited and basic support for WEBP format, se #132.
v0.7.14 (2016-08-08)
-------------------------------------
* Re-add removed cache directory.
* Make fast track cache disabled by default in the config file.
v0.7.13 (2016-08-08)
-------------------------------------
* Moved functions from img.php to `functions.php`.
* Added function `trace()` to measure speed and memory consumption, only for development.
* Added fast cache #149.
* Added `imgf.php` as shortcut to check for fast cache, before loading `img.php` as usual, adding `imgf_config.php` as symlink to `img_config.php`.
* Created `defines.php` and moved definition av version there.
* Fixed images in README, #148.
* Initiated dependency injection to `CImage`, class names can be set in config file and will be injected to `CImage` from `img.php`. Not implemented for all classes. #151.
* Enabled debug mode to make it easier to trace what actually happens while processing the image, #150.
v0.7.12 (2016-06-01)
-------------------------------------
* Fixed to correctly display image when using a resize strategy without height or width.
* Fixed background color for option `no-upscale`, #144.
v0.7.11 (2016-04-18)
-------------------------------------
* Add option for `skip_original` to config file to always skip original, #118.
v0.7.10 (2016-04-01)
-------------------------------------
* Add backup option for images `src-alt`, #141.
* Add require of ext-gd in composer.json, #133.
* Fix strict mode only reporting 404 when failure, #127.
v0.7.9 (2015-12-07)
-------------------------------------
* Strict mode only reporting 404 when failure, #127.
* Added correct CImage version to remote agent string, #131.
* Adding CCache to improve cache handling of caching for dummy, remote and srgb. #130.
v0.7.8 (2015-12-06)
-------------------------------------
* HTTP error messages now 403, 404 and 500 as in #128 and #127.
* More examples on dealing with cache through bash `bin/cache.bash`, #129.
* Added conversion to sRGB using option `?srgb`. #120.
* Added Gitter badge to README, #126.
* Fix proper download url in README, #125.
* Change path in `webroot/htaccess` to make it work in current environment.
v0.7.7 (2015-10-21)
-------------------------------------
* One can now add a HTTP header for Cache-Control in the config file, #109.
* Added hook in img,php before CImage is called, #123.
* Added configuration for default jpeg quality and png compression in the config file, #107.
* Strip comments and whitespace in imgs.php, #115.
* Bundle imgs.php did not have the correct mode.
* Adding option &status to get an overview of the installed on configured utilities, #116.
* Bug, all files saved as png-files, when not saving as specific file.
* Removed saving filename extension for alias images.
* Added option to decide if resample or resize when copying images internally. `&no-resample` makes resize, instead of resample as is default.
* Verbose now correctly states if transparent color is detected.
* Compare-tool now supports 6 images.
* Added option for dark background in the compare-tool.
* Removed that source png-files, containing less than 255 colors, is always saved as palette images since this migth depend on processing of the image.
* Adding save-as as part of the generated cache filename, #121.
* Add extra fields to json-response, #114.
* Add header for Content-Length, #111.
* Add check for postprocessing tools in path in `webroot/check_system.php`, #104.
v0.7.6 (2015-10-18)
-------------------------------------
* Adding testpage for dummy images `webroot/test/test_issue101-dummy.php`.
* Adding width and height when creating dummy image.
v0.7.5 (2015-10-18)
-------------------------------------
* Adding feature for creating dummy images `src=dummy`, #101.
* Add png compression to generated cache filename, fix #103.
* Removed file prefix from storing images in cache, breaking filenamestructure for cache images.
* Code cleaning in `CImage.php`.
v0.7.4 (2015-09-15)
-------------------------------------
* Add CAsciiArt.php to composer for autoloading, fix #102.
* Generate filename with filters, does not work on Windows, fix #100.
v0.7.3 (2015-09-01)
-------------------------------------
* Support output of ascii images, #67.
v0.7.2 (2015-08-17)
-------------------------------------
* Allow space in remote filenames, fix #98.
v0.7.1 (2015-07-25)
-------------------------------------
* Support for password hashes using `text`, `md5` and `hash`, fix #77.
* Using `CWhitelist` for checking hotlinking to images, fix #88.
* Added mode for `test` which enables logging verbose mode to file, fix #97.
* Improved codestyle and added `phpcs.xml` to start using phpcs to check code style, fix #95.
* Adding `composer.json` for publishing on packagist.
* Add permalink to setup for comparing images with `webroot/compare/compare.php`, fix #92.
* Allow space in filename by using `urlencode()` and allow space as valid filenam character. fix #91.
* Support redirections for remote images, fix #87, fix #90.
* Improving usage of Travis and Scrutinizer.
* Naming cache-file using md5 for remote images, fix #86.
* Loading images without depending on filename extension, fix #85.
* Adding unittest with phpunit #84, fix #13
* Adding support for whitelist of remote hostnames, #84
* Adding phpdoc, fix #48.
* Adding travis, fix #15.
* Adding scrutinizer, fix #57.
v0.7.0 (2015-02-10)
-------------------------------------
* Always use password, setting in img_config.php, fix #78.
* Resize gif keeping transparency #81.
* Now returns statuscode 500 when something fails #55.
* Three different modes: strict, production, development #44.
* Three files for all-in-one `imgs.php`, `imgp.php`, `imgd.php` #73.
* Change name of script all-in-one to `webroot/imgs.php` #73.
* Combine all code into one singel script, `webroot/img_single.php` #73.
* Disallow hotlinking/leeching by configuration #46.
* Alias-name is without extension #47.
* Option `alias` now requires `password` to work #47.
* Support for option `password, pwd` to protect usage of `alias` and remote download.
* Added support for option `alias` that creates a link to a cached version of the image #47.
* Create cache directory for remote download if it does not exists.
* Cleaned up `img_config.php` and introduced default values for almost all options #72.
v0.6.2 (2015-01-14)
-------------------------------------
* Added support for download of remote images #43.
* Added autoloader.
v0.6.1 (2015-01-08)
-------------------------------------
* Adding compare-page for comparing images. Issue #20.
* Added option `no-upscale, nu` as resizing strategy to decline upscaling of smaller images. Fix #61.
* Minor change in `CImage::resize()`, crop now does imagecopy without resamling.
* Correcting internal details for save-as and response json which indicated wrong colors. Fix #62.
* Fixed fill-to-fit that failed when using aspect-ratio. Fix #52.
* JSON returns correct values for resulting image. Fix #58.
* Corrected behaviour for skip-original. Fix #60.
v0.6 (2014-12-06)
-------------------------------------
* Rewrote and added documentation.
* Moved conolution expressesion from `img_config.php` to `CImage`.
* Minor cleaning of properties in `CImage`. Fix #23.
* Adding `webroot/htaccess` to show off how friendly urls can be created for `img.php`. Fix #45.
* Added option `fill-to-fit, ff`. Fix #38.
* Added option `shortcut, sc` to enable configuration of complex expressions. Fix #2.
* Added support for custom convolutions. Fix #49.
* Restructured testprograms. Fix #41.
* Corrected json on PHP 5.3. Fix #42.
* Improving template for tests in `webroot/tests` when testing out #40.
* Adding testcase for #40.
* Adding option `convolve` taking comma-separated list of 11 float-values, wraps and exposes `imageconvoluttion()`. #4
* Adding option `dpr, device-pixel-ratio` which defaults to 1. Set to 2 to get a twice as large image. Useful for Retina displays. Basically a shortcut to enlarge the image.
* Adding utility `cache.bash` to ease gathering stats on cache usage. #21
* Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5
* Cache now uses same file extension as original image #37.
* Can output image as json format using `json` #11.
v0.5.3 (2014-11-21)
-------------------------------------
* Support filenames of uppercase JPEG, JPG, PNG and GIF, as proposed in #37.
* Changing `CImage::output()` as proposed in #37.
* Adding security check that image filename is always below the path `image_path` as specified in `img_config.php` #37.
* Adding configuration item in `img_config.php` for setting valid characters in image filename.
* Moving `webroot/test*` into directory `webroot/test`.
* `webroot/check_system.php` now outputs if extension for exif is loaded.
* Broke API when `initDimensions()` split into two methods, new `initDimensions()` and `loadImageDetails()`.
* Added `autoRotate, aro` to auto rotate image based on EXIF information.
* Added `bgColor, bgc` to use as backgroundcolor when needing a filler color, for example rotate 45.
* Added `rotateBefore, rb` to rotate image a certain angle before processing.
* Added `rotateAfter, ra` to rotate image a certain angle after processing.
* Cleaned up code formatting, removed trailing spaces.
* Removed @ from opening images, better to display correct warning when failing #34, but put it back again.
* Setting gd.jpeg_ignore_warning to true as default #34.
* `webroot/check_system.php` now outputs version of PHP and GD.
* #32 correctly send 404 header when serving an error message.
* Trying to verify issue #29, but can not.
* Adding structure for testprograms together with, use `webroot/test_issue29.php` as sample.
* Improving code formatting.
* Moving parts of verbose output from img.php to CImage.php.
v0.5.2 (2014-04-01)
-------------------------------------
* Correcting issue #26 providing error message when not using postprocessing.
* Correcting issue #27 warning of default timezone.
* Removed default $config options in `img.php`, was not used, all configuration should be in `img_config.php`.
* Verified known bug - sharpen acts as blur in PHP 5.5.9 and 5.5.10 #28
v0.5.1 (2014-02-12)
-------------------------------------
* Display image in README-file.
* Create an empty `cache` directory as part of repo.
v0.5 (2014-02-12)
-------------------------------------
* Change constant name `CImage::PNG_QUALITY_DEFAULT` to `CImage::PNG_COMPRESSION_DEFAULT`.
* Split JPEG quality and PNG compression, `CImage->quality` and `CImage->compression`
* Changed `img.php` parameter name `d, deflate` to `co, compress`.
* Separating configuration issues from `img.php` to `img_config.php`.
* Format code according to PSR-2.
* Disabled post-processing JPEG and PNG as default.
* This version is supporting PHP 5.3, later versions will require 5.5 or later.
* Using GitHub issue tracking for feature requests and planning.
* Rewrote [the manual](http://dbwebb.se/opensource/cimage).
* Created directory `webroot` and moved some files there.
v0.4.1 (2014-01-27)
-------------------------------------
* Changed => to == on Modified-Since.
* Always send Last-Modified-Header.
* Added `htmlentities()` to verbose output.
* Fixed support for jpeg, not only jpg.
* Fixed crop whole image by setting crop=0,0,0,0
* Use negative values for crop width & height to base calulation on original width/height and withdraw selected amount.
* Correcting jpeg when setting quality.
* Removed obsolete reference to `$newName` in `CImage::__construct()` (issue 1).
v0.4 (2013-10-08)
-------------------------------------
* Improved support for pre-defined sizes.
* Adding grid column size as predefined size, c1-c24 for a 24 column grid. Configure in `img.php`.
* Corrected error on naming cache-files using subdir.
* Corrected calculation error on width & height for crop-to-fit.
* Adding effects for sharpen, emboss and blur through imageconvolution using matrixes.
* crop-to-fit, add parameter for offset x and y to enable to define which area is the, implemented as area.
* Support for resizing opaque images.
* Center of the image from which the crop is done. Improved usage of area to crop.
* Added support for % in width & height.
* Added aspect-ratio.
* Added scale.
* Quality for PNG images is now knows as deflate.
* Added palette to create images with max 256 colors.
* Added usage of all parameters to README.md
* Added documentation here http://dbwebb.se/opensource/cimage
* Adding `.gitignore`
* Re-adding `cache` directory
v0.3 (2012-10-02)
-------------------------------------
* Added crop. Can crop a area (`width`, `height`, `start_x`, `start_y`) from the original
image.
* Corrected to make the 304 Not Modified header work.
* Predefined sizes can be configured for width in `img.php`.
* Corrected to make crop work with width or height in combination with crop-to-fit.
v0.2 (2012-05-09)
-------------------------------------
* Implemented filters as in http://php.net/manual/en/function.imagefilter.php
* Changed `crop` to `crop_to_fit`, works the same way.
* Changed arguments and sends them in array.
* Added quality-setting.
* Added testcases for above.
v0.1.1 (2012-04-27)
-------------------------------------
* Corrected calculation where both width and height were set.
v0.1 (2012-04-25)
-------------------------------------
* Initial release after rewriting some older code doing the same, but not that good and flexible.

24
autoload.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
/**
* Autoloader for CImage and related class files.
*
*/
require_once __DIR__ . "/defines.php";
require_once __DIR__ . "/functions.php";
/**
* Autoloader for classes.
*
* @param string $class the fully-qualified class name.
*
* @return void
*/
spl_autoload_register(function ($class) {
//$path = CIMAGE_SOURCE_PATH . "/{$class}.php";
$path = __DIR__ . "/{$class}.php";
if (is_file($path)) {
require($path);
}
});

43
bin/cache.bash Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
#
# ls -ult list and sorts fils by its access time
#
#
# Main, start by checking basic usage
#
if [ $# -lt 1 ]
then
echo "Usage: $0 [cache-dir]"
exit 1
elif [ ! -d "$1" ]; then
echo "Usage: $0 [cache-dir]"
echo "$1 is not a directory."
exit 1
fi
#
# Print out details on cache-directory
#
echo "# Size"
echo "Total size: $( du -sh $1 | cut -f1 )"
echo "Number of files: $( find $1 -type f | wc -l )"
echo "Number of dirs: $( find $1 -type d | wc -l )"
echo
echo "# Top-5 largest files/dirs:"
echo "$( du -s $1/* | sort -nr | head -5 )"
echo
echo "# Last-5 created files:"
echo "$( find $1 -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -r | head -5 )"
echo
echo "# Last-5 accessed files:"
echo "$( find $1 -type f -printf '%AY-%Am-%Ad %AH:%AM %f\n' | sort -r | head -5 )"
echo
echo "# 5 Oldest files:"
echo "$( find $1 -type f -printf '%AY-%Am-%Ad %AH:%AM %f\n' | sort | head -5 )"
echo
echo "# Files not accessed within the last 30 days"
echo "Number of files: $( find $1 -type f -atime +30 | wc -l )"
echo "Total file size: $( find $1 -type f -atime +30 -exec du {} \; | cut -f1 | paste -sd+ | bc )"
echo

100
bin/create-img-single.bash Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
#
# Paths and settings
#
TARGET_D="webroot/imgd.php"
TARGET_P="webroot/imgp.php"
TARGET_S="webroot/imgs.php"
NEWLINES="\n\n\n"
#
# Specify the utilities used
#
ECHO="printf"
#
# Main, start by checking basic usage
#
if [ $# -gt 0 ]
then
$ECHO "Usage: $0\n"
exit 1
fi
#
# Print out details on cache-directory
#
$ECHO "Creating '$TARGET_D', '$TARGET_P' and '$TARGET_S' by combining the following files:"
$ECHO "\n"
$ECHO "\n webroot/img_header.php"
$ECHO "\n defines.php"
$ECHO "\n functions.php"
$ECHO "\n CHttpGet.php"
$ECHO "\n CRemoteImage.php"
$ECHO "\n CWhitelist.php"
$ECHO "\n CAsciiArt.php"
$ECHO "\n CImage.php"
$ECHO "\n CCache.php"
$ECHO "\n CFastTrackCache.php"
$ECHO "\n webroot/img.php"
$ECHO "\n"
$ECHO "\n'$TARGET_D' is for development mode."
$ECHO "\n'$TARGET_P' is for production mode (default mode)."
$ECHO "\n'$TARGET_S' is for strict mode."
$ECHO "\n"
$ECHO "\nPress enter to continue. "
read answer
#
# Create the $TARGET_? files
#
cat webroot/img_header.php > $TARGET_P
cat webroot/img_header.php | sed "s|//'mode' => 'production',|'mode' => 'development',|" > $TARGET_D
cat webroot/img_header.php | sed "s|//'mode' => 'production',|'mode' => 'strict',|" > $TARGET_S
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 defines.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 functions.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CHttpGet.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CRemoteImage.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CWhitelist.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CAsciiArt.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CImage.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CCache.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 CFastTrackCache.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
tail -n +2 webroot/img.php | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
$ECHO "$NEWLINES" | tee -a $TARGET_D $TARGET_P $TARGET_S > /dev/null
php -w $TARGET_S > tmp && mv tmp $TARGET_S
$ECHO "\nDone."
$ECHO "\n"
$ECHO "\n"

4
cache/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

42
composer.json Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "mos/cimage",
"type": "library",
"description": "Process, scale, resize, crop and filter images.",
"keywords": ["image", "imageprocessing", "gd"],
"homepage": "http://dbwebb.se/opensource/cimage",
"license": "MIT",
"authors": [
{
"name": "Mikael Roos",
"email": "me@mikaelroos.se",
"homepage": "http://mikaelroos.se",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/mosbth/cimage/issues",
"docs": "http://dbwebb.se/opensource/cimage"
},
"require": {
"php": ">=5.3",
"ext-gd": "*"
},
"suggest": {
"ext-exif": "*"
},
"autoload": {
"files": [
"defines.php",
"functions.php"
],
"classmap": [
"CImage.php",
"CHttpGet.php",
"CRemoteImage.php",
"CWhitelist.php",
"CAsciiArt.php",
"CCache.php",
"CFastTrackCache.php"
]
}
}

11
defines.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
// Version of cimage and img.php
define("CIMAGE_VERSION", "v0.7.15 (2016-08-09)");
// For CRemoteImage
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
// Image type IMG_WEBP is only defined from 5.6.25
if (!defined("IMG_WEBP")) {
define("IMG_WEBP", -1);
}

5
docs/api/.htaccess Normal file
View File

@@ -0,0 +1,5 @@
# Fixes a vulnerability in CentOS: http://stackoverflow.com/questions/20533279/prevent-php-from-parsing-non-php-files-such-as-somefile-php-txt
<FilesMatch \.php\.txt$>
RemoveHandler .php
ForceType text/plain
</FilesMatch>

View File

@@ -0,0 +1,731 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1847469476"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1847469476" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CAsciiArt</h1>
<p><em>Create an ASCII version of an image.</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CAsciiArt.html#method___construct" class="">__construct()</a><br />
<a href="../classes/CAsciiArt.html#method_addCharacterSet" class="">addCharacterSet()</a><br />
<a href="../classes/CAsciiArt.html#method_setOptions" class="">setOptions()</a><br />
<a href="../classes/CAsciiArt.html#method_createFromFile" class="">createFromFile()</a><br />
<a href="../classes/CAsciiArt.html#method_luminanceAreaAverage" class="">luminanceAreaAverage()</a><br />
<a href="../classes/CAsciiArt.html#method_getLuminance" class="">getLuminance()</a><br />
<a href="../classes/CAsciiArt.html#method_luminance2character" class="">luminance2character()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CAsciiArt.html#property_characterSet" class="">$characterSet</a><br />
<a href="../classes/CAsciiArt.html#property_characters" class="">$characters</a><br />
<a href="../classes/CAsciiArt.html#property_charCount" class="">$charCount</a><br />
<a href="../classes/CAsciiArt.html#property_scale" class="">$scale</a><br />
<a href="../classes/CAsciiArt.html#property_luminanceStrategy" class="">$luminanceStrategy</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/CAsciiArt.html"><div class="path-wrapper">CAsciiArt.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\CAsciiArt</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_characterSet" name="property_characterSet" class="anchor"></a>
<article class="property">
<h3 class="private ">$characterSet</h3>
<pre class="signature">$characterSet : </pre>
<p><em>Character set to use.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_characters" name="property_characters" class="anchor"></a>
<article class="property">
<h3 class="private ">$characters</h3>
<pre class="signature">$characters : </pre>
<p><em>Current character set.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_charCount" name="property_charCount" class="anchor"></a>
<article class="property">
<h3 class="private ">$charCount</h3>
<pre class="signature">$charCount : </pre>
<p><em>Length of current character set.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_scale" name="property_scale" class="anchor"></a>
<article class="property">
<h3 class="private ">$scale</h3>
<pre class="signature">$scale : </pre>
<p><em>Scale of the area to swap to a character.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_luminanceStrategy" name="property_luminanceStrategy" class="anchor"></a>
<article class="property">
<h3 class="private ">$luminanceStrategy</h3>
<pre class="signature">$luminanceStrategy : </pre>
<p><em>Strategy to calculate luminance.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method___construct" name="method___construct" class="anchor"></a>
<article class="method">
<h3 class="public ">__construct()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">__construct() </pre>
<p><em>Constructor which sets default options.</em></p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_addCharacterSet" name="method_addCharacterSet" class="anchor"></a>
<article class="method">
<h3 class="public ">addCharacterSet()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">addCharacterSet(string <span class="argument">$key</span>, string <span class="argument">$value</span>) : $this</pre>
<p><em>Add a custom character set.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$key </td>
<td><p>for the character set.</p></td>
</tr>
<tr>
<td>string</td>
<td>$value </td>
<td><p>for the character set.</p></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setOptions" name="method_setOptions" class="anchor"></a>
<article class="method">
<h3 class="public ">setOptions()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setOptions(array <span class="argument">$options = array()</span>) : $this</pre>
<p><em>Set options for processing, defaults are available.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>array</td>
<td>$options </td>
<td><p>to use as default settings.</p></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_createFromFile" name="method_createFromFile" class="anchor"></a>
<article class="method">
<h3 class="public ">createFromFile()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">createFromFile(string <span class="argument">$filename</span>) : string</pre>
<p><em>Create an Ascii image from an image file.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$filename </td>
<td><p>of the image to use.</p></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>$ascii with the ASCII image.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_luminanceAreaAverage" name="method_luminanceAreaAverage" class="anchor"></a>
<article class="method">
<h3 class="public ">luminanceAreaAverage()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">luminanceAreaAverage(string <span class="argument">$img</span>, integer <span class="argument">$x1</span>, integer <span class="argument">$y1</span>, integer <span class="argument">$x2</span>, integer <span class="argument">$y2</span>) : integer</pre>
<p><em>Get the luminance from a region of an image using average color value.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$img </td>
<td><p>the image.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$x1 </td>
<td><p>the area to get pixels from.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$y1 </td>
<td><p>the area to get pixels from.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$x2 </td>
<td><p>the area to get pixels from.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$y2 </td>
<td><p>the area to get pixels from.</p></td>
</tr>
</table>
<h4>Returns</h4>
integer
&mdash; <p>$luminance with a value between 0 and 100.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getLuminance" name="method_getLuminance" class="anchor"></a>
<article class="method">
<h3 class="public ">getLuminance()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getLuminance(integer <span class="argument">$red</span>, integer <span class="argument">$green</span>, integer <span class="argument">$blue</span>) : float</pre>
<p><em>Calculate luminance value with different strategies.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>integer</td>
<td>$red </td>
<td><p>The color red.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$green </td>
<td><p>The color green.</p></td>
</tr>
<tr>
<td>integer</td>
<td>$blue </td>
<td><p>The color blue.</p></td>
</tr>
</table>
<h4>Returns</h4>
float
&mdash; <p>$luminance with a value between 0 and 1.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_luminance2character" name="method_luminance2character" class="anchor"></a>
<article class="method">
<h3 class="public ">luminance2character()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">luminance2character( <span class="argument">$luminance</span>) : string</pre>
<p><em>Translate the luminance value to a character.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$luminance </td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>with the ascii character.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CAsciiArt.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/CAsciiArt.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,788 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-603682456"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-603682456" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CHttpGet</h1>
<p><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CHttpGet.html#method___construct" class="">__construct()</a><br />
<a href="../classes/CHttpGet.html#method_buildUrl" class="">buildUrl()</a><br />
<a href="../classes/CHttpGet.html#method_setUrl" class="">setUrl()</a><br />
<a href="../classes/CHttpGet.html#method_setHeader" class="">setHeader()</a><br />
<a href="../classes/CHttpGet.html#method_parseHeader" class="">parseHeader()</a><br />
<a href="../classes/CHttpGet.html#method_doGet" class="">doGet()</a><br />
<a href="../classes/CHttpGet.html#method_getStatus" class="">getStatus()</a><br />
<a href="../classes/CHttpGet.html#method_getLastModified" class="">getLastModified()</a><br />
<a href="../classes/CHttpGet.html#method_getContentType" class="">getContentType()</a><br />
<a href="../classes/CHttpGet.html#method_getDate" class="">getDate()</a><br />
<a href="../classes/CHttpGet.html#method_getMaxAge" class="">getMaxAge()</a><br />
<a href="../classes/CHttpGet.html#method_getBody" class="">getBody()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CHttpGet.html#property_request" class="">$request</a><br />
<a href="../classes/CHttpGet.html#property_response" class="">$response</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/CHttpGet.html"><div class="path-wrapper">CHttpGet.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\CHttpGet</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_request" name="property_request" class="anchor"></a>
<article class="property">
<h3 class="private ">$request</h3>
<pre class="signature">$request : </pre>
<p><em></em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_response" name="property_response" class="anchor"></a>
<article class="property">
<h3 class="private ">$response</h3>
<pre class="signature">$response : </pre>
<p><em></em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method___construct" name="method___construct" class="anchor"></a>
<article class="method">
<h3 class="public ">__construct()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">__construct() </pre>
<p><em>Constructor</em></p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_buildUrl" name="method_buildUrl" class="anchor"></a>
<article class="method">
<h3 class="public ">buildUrl()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">buildUrl(string <span class="argument">$baseUrl</span>, string <span class="argument">$merge</span>) : string</pre>
<p><em>Build an encoded url.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$baseUrl </td>
<td><p>This is the original url which will be merged.</p></td>
</tr>
<tr>
<td>string</td>
<td>$merge </td>
<td><p>Thse parts should be merged into the baseUrl,
the format is as parse_url.</p></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>$url as the modified url.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setUrl" name="method_setUrl" class="anchor"></a>
<article class="method">
<h3 class="public ">setUrl()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setUrl(string <span class="argument">$url</span>) : $this</pre>
<p><em>Set the url for the request.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$url </td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setHeader" name="method_setHeader" class="anchor"></a>
<article class="method">
<h3 class="public ">setHeader()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setHeader(string <span class="argument">$field</span>, string <span class="argument">$value</span>) : $this</pre>
<p><em>Set custom header field for the request.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$field </td>
<td></td>
</tr>
<tr>
<td>string</td>
<td>$value </td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_parseHeader" name="method_parseHeader" class="anchor"></a>
<article class="method">
<h3 class="public ">parseHeader()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">parseHeader() : $this</pre>
<p><em>Set header fields for the request.</em></p>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_doGet" name="method_doGet" class="anchor"></a>
<article class="method">
<h3 class="public ">doGet()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">doGet(boolean <span class="argument">$debug = false</span>) : boolean</pre>
<p><em>Perform the request.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>boolean</td>
<td>$debug </td>
<td><p>set to true to dump headers.</p></td>
</tr>
</table>
<h4>Throws</h4>
<dl>
<dt>\Exception</dt>
<dd><p>when curl fails to retrieve url.</p></dd>
</dl>
<h4>Returns</h4>
boolean
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getStatus" name="method_getStatus" class="anchor"></a>
<article class="method">
<h3 class="public ">getStatus()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getStatus() : integer</pre>
<p><em>Get HTTP code of response.</em></p>
<h4>Returns</h4>
integer
&mdash; <p>as HTTP status code or null if not available.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getLastModified" name="method_getLastModified" class="anchor"></a>
<article class="method">
<h3 class="public ">getLastModified()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getLastModified() : integer</pre>
<p><em>Get file modification time of response.</em></p>
<h4>Returns</h4>
integer
&mdash; <p>as timestamp.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getContentType" name="method_getContentType" class="anchor"></a>
<article class="method">
<h3 class="public ">getContentType()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getContentType() : string</pre>
<p><em>Get content type.</em></p>
<h4>Returns</h4>
string
&mdash; <p>as the content type or null if not existing or invalid.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDate" name="method_getDate" class="anchor"></a>
<article class="method">
<h3 class="public ">getDate()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDate(mixed <span class="argument">$default = false</span>) : integer</pre>
<p><em>Get file modification time of response.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>as default value (int seconds) if date is
missing in response header.</p></td>
</tr>
</table>
<h4>Returns</h4>
integer
&mdash; <p>as timestamp or $default if Date is missing in
response header.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getMaxAge" name="method_getMaxAge" class="anchor"></a>
<article class="method">
<h3 class="public ">getMaxAge()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getMaxAge(mixed <span class="argument">$default = false</span>) : integer</pre>
<p><em>Get max age of cachable item.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>as default value if date is missing in response
header.</p></td>
</tr>
</table>
<h4>Returns</h4>
integer
&mdash; <p>as timestamp or false if not available.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getBody" name="method_getBody" class="anchor"></a>
<article class="method">
<h3 class="public ">getBody()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getBody() : string</pre>
<p><em>Get body of response.</em></p>
<h4>Returns</h4>
string
&mdash; <p>as body.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CHttpGet.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/CHttpGet.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

4450
docs/api/classes/CImage.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,639 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-215373945"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-215373945" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CImage_RemoteDownloadTest</h1>
<p><em>A testclass</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CImage_RemoteDownloadTest.html#method_providerValidRemoteSource" class="">providerValidRemoteSource()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_providerInvalidRemoteSource" class="">providerInvalidRemoteSource()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_testAllowRemoteDownloadDefaultPatternValid" class="">testAllowRemoteDownloadDefaultPatternValid()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_testAllowRemoteDownloadDefaultPatternInvalid" class="">testAllowRemoteDownloadDefaultPatternInvalid()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_providerHostnameMatch" class="">providerHostnameMatch()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_testRemoteHostWhitelistMatch" class="">testRemoteHostWhitelistMatch()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_providerHostnameNoMatch" class="">providerHostnameNoMatch()</a><br />
<a href="../classes/CImage_RemoteDownloadTest.html#method_testRemoteHostWhitelistNoMatch" class="">testRemoteHostWhitelistNoMatch()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CImage_RemoteDownloadTest.html#property_remote_whitelist" class="">$remote_whitelist</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/test.CImage_RemoteDownloadTest.html"><div class="path-wrapper">test/CImage_RemoteDownloadTest.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\PHPUnit_Framework_TestCase</div>
<div class="namespace-wrapper">\CImage_RemoteDownloadTest</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_remote_whitelist" name="property_remote_whitelist" class="anchor"></a>
<article class="property">
<h3 class="private ">$remote_whitelist</h3>
<pre class="signature">$remote_whitelist : </pre>
<p><em></em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerValidRemoteSource" name="method_providerValidRemoteSource" class="anchor"></a>
<article class="method">
<h3 class="public ">providerValidRemoteSource()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerValidRemoteSource() : array</pre>
<p><em>Provider for valid remote sources.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerInvalidRemoteSource" name="method_providerInvalidRemoteSource" class="anchor"></a>
<article class="method">
<h3 class="public ">providerInvalidRemoteSource()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerInvalidRemoteSource() : array</pre>
<p><em>Provider for invalid remote sources.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testAllowRemoteDownloadDefaultPatternValid" name="method_testAllowRemoteDownloadDefaultPatternValid" class="anchor"></a>
<article class="method">
<h3 class="public ">testAllowRemoteDownloadDefaultPatternValid()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testAllowRemoteDownloadDefaultPatternValid( <span class="argument">$source</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$source </td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerValidRemoteSource</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testAllowRemoteDownloadDefaultPatternInvalid" name="method_testAllowRemoteDownloadDefaultPatternInvalid" class="anchor"></a>
<article class="method">
<h3 class="public ">testAllowRemoteDownloadDefaultPatternInvalid()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testAllowRemoteDownloadDefaultPatternInvalid( <span class="argument">$source</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$source </td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerInvalidRemoteSource</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerHostnameMatch" name="method_providerHostnameMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">providerHostnameMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerHostnameMatch() : array</pre>
<p><em>Provider for hostname matching the whitelist.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testRemoteHostWhitelistMatch" name="method_testRemoteHostWhitelistMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">testRemoteHostWhitelistMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testRemoteHostWhitelistMatch(string <span class="argument">$hostname</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$hostname </td>
<td><p>matches the whitelist</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerHostnameMatch</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerHostnameNoMatch" name="method_providerHostnameNoMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">providerHostnameNoMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerHostnameNoMatch() : array</pre>
<p><em>Provider for hostname not matching the whitelist.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testRemoteHostWhitelistNoMatch" name="method_testRemoteHostWhitelistNoMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">testRemoteHostWhitelistNoMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testRemoteHostWhitelistNoMatch(string <span class="argument">$hostname</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$hostname </td>
<td><p>not matching the whitelist</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerHostnameNoMatch</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CImage_RemoteDownloadTest.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/test/CImage_RemoteDownloadTest.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,903 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1171772037"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1171772037" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CRemoteImage</h1>
<p><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CRemoteImage.html#method_getStatus" class="">getStatus()</a><br />
<a href="../classes/CRemoteImage.html#method_getDetails" class="">getDetails()</a><br />
<a href="../classes/CRemoteImage.html#method_setCache" class="">setCache()</a><br />
<a href="../classes/CRemoteImage.html#method_isCacheWritable" class="">isCacheWritable()</a><br />
<a href="../classes/CRemoteImage.html#method_useCache" class="">useCache()</a><br />
<a href="../classes/CRemoteImage.html#method_setHeaderFields" class="">setHeaderFields()</a><br />
<a href="../classes/CRemoteImage.html#method_save" class="">save()</a><br />
<a href="../classes/CRemoteImage.html#method_updateCacheDetails" class="">updateCacheDetails()</a><br />
<a href="../classes/CRemoteImage.html#method_download" class="">download()</a><br />
<a href="../classes/CRemoteImage.html#method_loadCacheDetails" class="">loadCacheDetails()</a><br />
<a href="../classes/CRemoteImage.html#method_getCachedSource" class="">getCachedSource()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CRemoteImage.html#property_saveFolder" class="">$saveFolder</a><br />
<a href="../classes/CRemoteImage.html#property_useCache" class="">$useCache</a><br />
<a href="../classes/CRemoteImage.html#property_http" class="">$http</a><br />
<a href="../classes/CRemoteImage.html#property_status" class="">$status</a><br />
<a href="../classes/CRemoteImage.html#property_defaultMaxAge" class="">$defaultMaxAge</a><br />
<a href="../classes/CRemoteImage.html#property_url" class="">$url</a><br />
<a href="../classes/CRemoteImage.html#property_fileName" class="">$fileName</a><br />
<a href="../classes/CRemoteImage.html#property_fileJson" class="">$fileJson</a><br />
<a href="../classes/CRemoteImage.html#property_cache" class="">$cache</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/CRemoteImage.html"><div class="path-wrapper">CRemoteImage.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\CRemoteImage</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_saveFolder" name="property_saveFolder" class="anchor"></a>
<article class="property">
<h3 class="private ">$saveFolder</h3>
<pre class="signature">$saveFolder : </pre>
<p><em>Path to cache files.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_useCache" name="property_useCache" class="anchor"></a>
<article class="property">
<h3 class="private ">$useCache</h3>
<pre class="signature">$useCache : </pre>
<p><em>Use cache or not.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_http" name="property_http" class="anchor"></a>
<article class="property">
<h3 class="private ">$http</h3>
<pre class="signature">$http : </pre>
<p><em>HTTP object to aid in download file.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_status" name="property_status" class="anchor"></a>
<article class="property">
<h3 class="private ">$status</h3>
<pre class="signature">$status : </pre>
<p><em>Status of the HTTP request.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_defaultMaxAge" name="property_defaultMaxAge" class="anchor"></a>
<article class="property">
<h3 class="private ">$defaultMaxAge</h3>
<pre class="signature">$defaultMaxAge : </pre>
<p><em>Defalt age for cached items 60*60*24*7.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_url" name="property_url" class="anchor"></a>
<article class="property">
<h3 class="private ">$url</h3>
<pre class="signature">$url : </pre>
<p><em>Url of downloaded item.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_fileName" name="property_fileName" class="anchor"></a>
<article class="property">
<h3 class="private ">$fileName</h3>
<pre class="signature">$fileName : </pre>
<p><em>Base name of cache file for downloaded item and name of image.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_fileJson" name="property_fileJson" class="anchor"></a>
<article class="property">
<h3 class="private ">$fileJson</h3>
<pre class="signature">$fileJson : </pre>
<p><em>Filename for json-file with details of cached item.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_cache" name="property_cache" class="anchor"></a>
<article class="property">
<h3 class="private ">$cache</h3>
<pre class="signature">$cache : </pre>
<p><em>Cache details loaded from file.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getStatus" name="method_getStatus" class="anchor"></a>
<article class="method">
<h3 class="public ">getStatus()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getStatus() : integer</pre>
<p><em>Get status of last HTTP request.</em></p>
<h4>Returns</h4>
integer
&mdash; <p>as status</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDetails" name="method_getDetails" class="anchor"></a>
<article class="method">
<h3 class="public ">getDetails()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDetails() : array</pre>
<p><em>Get JSON details for cache item.</em></p>
<h4>Returns</h4>
array
&mdash; <p>with json details on cache.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setCache" name="method_setCache" class="anchor"></a>
<article class="method">
<h3 class="public ">setCache()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setCache( <span class="argument">$path</span>) : $this</pre>
<p><em>Set the path to the cache directory.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$path </td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_isCacheWritable" name="method_isCacheWritable" class="anchor"></a>
<article class="method">
<h3 class="public ">isCacheWritable()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">isCacheWritable() : $this</pre>
<p><em>Check if cache is writable or throw exception.</em></p>
<h4>Throws</h4>
<dl>
<dt>\Exception</dt>
<dd><p>if cahce folder is not writable.</p></dd>
</dl>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_useCache" name="method_useCache" class="anchor"></a>
<article class="method">
<h3 class="public ">useCache()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">useCache(boolean <span class="argument">$use = true</span>) : $this</pre>
<p><em>Decide if the cache should be used or not before trying to download
a remote file.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>boolean</td>
<td>$use </td>
<td><p>true to use the cache and false to ignore cache.</p></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setHeaderFields" name="method_setHeaderFields" class="anchor"></a>
<article class="method">
<h3 class="public ">setHeaderFields()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setHeaderFields() : $this</pre>
<p><em>Set header fields.</em></p>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_save" name="method_save" class="anchor"></a>
<article class="method">
<h3 class="public ">save()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">save() : string</pre>
<p><em>Save downloaded resource to cache.</em></p>
<h4>Returns</h4>
string
&mdash; <p>as path to saved file or false if not saved.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_updateCacheDetails" name="method_updateCacheDetails" class="anchor"></a>
<article class="method">
<h3 class="public ">updateCacheDetails()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">updateCacheDetails() : string</pre>
<p><em>Got a 304 and updates cache with new age.</em></p>
<h4>Returns</h4>
string
&mdash; <p>as path to cached file.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_download" name="method_download" class="anchor"></a>
<article class="method">
<h3 class="public ">download()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">download(string <span class="argument">$url</span>) : string</pre>
<p><em>Download a remote file and keep a cache of downloaded files.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$url </td>
<td><p>a remote url.</p></td>
</tr>
</table>
<h4>Throws</h4>
<dl>
<dt>\Exception</dt>
<dd><p>when status code does not match 200 or 304.</p></dd>
</dl>
<h4>Returns</h4>
string
&mdash; <p>as path to downloaded file or false if failed.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_loadCacheDetails" name="method_loadCacheDetails" class="anchor"></a>
<article class="method">
<h3 class="public ">loadCacheDetails()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">loadCacheDetails() : $this</pre>
<p><em>Get the path to the cached image file if the cache is valid.</em></p>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getCachedSource" name="method_getCachedSource" class="anchor"></a>
<article class="method">
<h3 class="public ">getCachedSource()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getCachedSource() : string</pre>
<p><em>Get the path to the cached image file if the cache is valid.</em></p>
<h4>Returns</h4>
string
&mdash; <p>as the path ot the image file or false if no cache.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CRemoteImage.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/CRemoteImage.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,425 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1100227540"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1100227540" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CWhitelist</h1>
<p><em>Act as whitelist (or blacklist).</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CWhitelist.html#method_set" class="">set()</a><br />
<a href="../classes/CWhitelist.html#method_check" class="">check()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CWhitelist.html#property_whitelist" class="">$whitelist</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/CWhitelist.html"><div class="path-wrapper">CWhitelist.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\CWhitelist</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_whitelist" name="property_whitelist" class="anchor"></a>
<article class="property">
<h3 class="private ">$whitelist</h3>
<pre class="signature">$whitelist : </pre>
<p><em>Array to contain the whitelist options.</em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_set" name="method_set" class="anchor"></a>
<article class="method">
<h3 class="public ">set()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">set(array <span class="argument">$whitelist = array()</span>) : $this</pre>
<p><em>Set the whitelist from an array of strings, each item in the
whitelist should be a regexp without the surrounding / or #.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>array</td>
<td>$whitelist </td>
<td><p>with all valid options,
default is to clear the whitelist.</p></td>
</tr>
</table>
<h4>Returns</h4>
$this
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_check" name="method_check" class="anchor"></a>
<article class="method">
<h3 class="public ">check()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">check(string <span class="argument">$item</span>, array <span class="argument">$whitelist = null</span>) : boolean</pre>
<p><em>Check if item exists in the whitelist.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$item </td>
<td><p>string to check.</p></td>
</tr>
<tr>
<td>array</td>
<td>$whitelist </td>
<td><p>optional with all valid options, default is null.</p></td>
</tr>
</table>
<h4>Returns</h4>
boolean
&mdash; <p>true if item is in whitelist, else false.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CWhitelist.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/CWhitelist.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,497 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1563306956"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1563306956" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>\</small>CWhitelistTest</h1>
<p><em>A testclass</em></p>
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/CWhitelistTest.html#method_providerHostnameMatch" class="">providerHostnameMatch()</a><br />
<a href="../classes/CWhitelistTest.html#method_providerHostnameNoMatch" class="">providerHostnameNoMatch()</a><br />
<a href="../classes/CWhitelistTest.html#method_testRemoteHostWhitelistMatch" class="">testRemoteHostWhitelistMatch()</a><br />
<a href="../classes/CWhitelistTest.html#method_testRemoteHostWhitelistNoMatch" class="">testRemoteHostWhitelistNoMatch()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
</section>
<section class="span4">
<a href="../classes/CWhitelistTest.html#property_remote_whitelist" class="">$remote_whitelist</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/test.CWhitelistTest.html"><div class="path-wrapper">test/CWhitelistTest.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">Default</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\PHPUnit_Framework_TestCase</div>
<div class="namespace-wrapper">\CWhitelistTest</div>
</dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="property_remote_whitelist" name="property_remote_whitelist" class="anchor"></a>
<article class="property">
<h3 class="private ">$remote_whitelist</h3>
<pre class="signature">$remote_whitelist : </pre>
<p><em></em></p>
<h4>Type</h4>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerHostnameMatch" name="method_providerHostnameMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">providerHostnameMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerHostnameMatch() : array</pre>
<p><em>Provider for hostname matching the whitelist.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_providerHostnameNoMatch" name="method_providerHostnameNoMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">providerHostnameNoMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">providerHostnameNoMatch() : array</pre>
<p><em>Provider for hostname not matching the whitelist.</em></p>
<h4>Returns</h4>
array
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testRemoteHostWhitelistMatch" name="method_testRemoteHostWhitelistMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">testRemoteHostWhitelistMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testRemoteHostWhitelistMatch(string <span class="argument">$hostname</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$hostname </td>
<td><p>matches the whitelist</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerHostnameMatch</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_testRemoteHostWhitelistNoMatch" name="method_testRemoteHostWhitelistNoMatch" class="anchor"></a>
<article class="method">
<h3 class="public ">testRemoteHostWhitelistNoMatch()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">testRemoteHostWhitelistNoMatch(string <span class="argument">$hostname</span>) : void</pre>
<p><em>Test</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$hostname </td>
<td><p>not matching the whitelist</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
dataProvider
</th>
<td>
<p>providerHostnameNoMatch</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">CWhitelistTest.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/test/CWhitelistTest.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

403
docs/api/css/font-awesome.min.css vendored Normal file
View File

@@ -0,0 +1,403 @@
@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;}
[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
a [class^="icon-"],a [class*=" icon-"]{display:inline;}
[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;}
.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;}
.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;}
[class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
.icon-muted{color:#eeeeee;}
.icon-light{color:#ffffff;}
.icon-dark{color:#333333;}
.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
.pull-right{float:right;}
.pull-left{float:left;}
[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;}
.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;}
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;}
.icon-glass:before{content:"\f000";}
.icon-music:before{content:"\f001";}
.icon-search:before{content:"\f002";}
.icon-envelope-alt:before{content:"\f003";}
.icon-heart:before{content:"\f004";}
.icon-star:before{content:"\f005";}
.icon-star-empty:before{content:"\f006";}
.icon-user:before{content:"\f007";}
.icon-film:before{content:"\f008";}
.icon-th-large:before{content:"\f009";}
.icon-th:before{content:"\f00a";}
.icon-th-list:before{content:"\f00b";}
.icon-ok:before{content:"\f00c";}
.icon-remove:before{content:"\f00d";}
.icon-zoom-in:before{content:"\f00e";}
.icon-zoom-out:before{content:"\f010";}
.icon-power-off:before,.icon-off:before{content:"\f011";}
.icon-signal:before{content:"\f012";}
.icon-gear:before,.icon-cog:before{content:"\f013";}
.icon-trash:before{content:"\f014";}
.icon-home:before{content:"\f015";}
.icon-file-alt:before{content:"\f016";}
.icon-time:before{content:"\f017";}
.icon-road:before{content:"\f018";}
.icon-download-alt:before{content:"\f019";}
.icon-download:before{content:"\f01a";}
.icon-upload:before{content:"\f01b";}
.icon-inbox:before{content:"\f01c";}
.icon-play-circle:before{content:"\f01d";}
.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";}
.icon-refresh:before{content:"\f021";}
.icon-list-alt:before{content:"\f022";}
.icon-lock:before{content:"\f023";}
.icon-flag:before{content:"\f024";}
.icon-headphones:before{content:"\f025";}
.icon-volume-off:before{content:"\f026";}
.icon-volume-down:before{content:"\f027";}
.icon-volume-up:before{content:"\f028";}
.icon-qrcode:before{content:"\f029";}
.icon-barcode:before{content:"\f02a";}
.icon-tag:before{content:"\f02b";}
.icon-tags:before{content:"\f02c";}
.icon-book:before{content:"\f02d";}
.icon-bookmark:before{content:"\f02e";}
.icon-print:before{content:"\f02f";}
.icon-camera:before{content:"\f030";}
.icon-font:before{content:"\f031";}
.icon-bold:before{content:"\f032";}
.icon-italic:before{content:"\f033";}
.icon-text-height:before{content:"\f034";}
.icon-text-width:before{content:"\f035";}
.icon-align-left:before{content:"\f036";}
.icon-align-center:before{content:"\f037";}
.icon-align-right:before{content:"\f038";}
.icon-align-justify:before{content:"\f039";}
.icon-list:before{content:"\f03a";}
.icon-indent-left:before{content:"\f03b";}
.icon-indent-right:before{content:"\f03c";}
.icon-facetime-video:before{content:"\f03d";}
.icon-picture:before{content:"\f03e";}
.icon-pencil:before{content:"\f040";}
.icon-map-marker:before{content:"\f041";}
.icon-adjust:before{content:"\f042";}
.icon-tint:before{content:"\f043";}
.icon-edit:before{content:"\f044";}
.icon-share:before{content:"\f045";}
.icon-check:before{content:"\f046";}
.icon-move:before{content:"\f047";}
.icon-step-backward:before{content:"\f048";}
.icon-fast-backward:before{content:"\f049";}
.icon-backward:before{content:"\f04a";}
.icon-play:before{content:"\f04b";}
.icon-pause:before{content:"\f04c";}
.icon-stop:before{content:"\f04d";}
.icon-forward:before{content:"\f04e";}
.icon-fast-forward:before{content:"\f050";}
.icon-step-forward:before{content:"\f051";}
.icon-eject:before{content:"\f052";}
.icon-chevron-left:before{content:"\f053";}
.icon-chevron-right:before{content:"\f054";}
.icon-plus-sign:before{content:"\f055";}
.icon-minus-sign:before{content:"\f056";}
.icon-remove-sign:before{content:"\f057";}
.icon-ok-sign:before{content:"\f058";}
.icon-question-sign:before{content:"\f059";}
.icon-info-sign:before{content:"\f05a";}
.icon-screenshot:before{content:"\f05b";}
.icon-remove-circle:before{content:"\f05c";}
.icon-ok-circle:before{content:"\f05d";}
.icon-ban-circle:before{content:"\f05e";}
.icon-arrow-left:before{content:"\f060";}
.icon-arrow-right:before{content:"\f061";}
.icon-arrow-up:before{content:"\f062";}
.icon-arrow-down:before{content:"\f063";}
.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";}
.icon-resize-full:before{content:"\f065";}
.icon-resize-small:before{content:"\f066";}
.icon-plus:before{content:"\f067";}
.icon-minus:before{content:"\f068";}
.icon-asterisk:before{content:"\f069";}
.icon-exclamation-sign:before{content:"\f06a";}
.icon-gift:before{content:"\f06b";}
.icon-leaf:before{content:"\f06c";}
.icon-fire:before{content:"\f06d";}
.icon-eye-open:before{content:"\f06e";}
.icon-eye-close:before{content:"\f070";}
.icon-warning-sign:before{content:"\f071";}
.icon-plane:before{content:"\f072";}
.icon-calendar:before{content:"\f073";}
.icon-random:before{content:"\f074";}
.icon-comment:before{content:"\f075";}
.icon-magnet:before{content:"\f076";}
.icon-chevron-up:before{content:"\f077";}
.icon-chevron-down:before{content:"\f078";}
.icon-retweet:before{content:"\f079";}
.icon-shopping-cart:before{content:"\f07a";}
.icon-folder-close:before{content:"\f07b";}
.icon-folder-open:before{content:"\f07c";}
.icon-resize-vertical:before{content:"\f07d";}
.icon-resize-horizontal:before{content:"\f07e";}
.icon-bar-chart:before{content:"\f080";}
.icon-twitter-sign:before{content:"\f081";}
.icon-facebook-sign:before{content:"\f082";}
.icon-camera-retro:before{content:"\f083";}
.icon-key:before{content:"\f084";}
.icon-gears:before,.icon-cogs:before{content:"\f085";}
.icon-comments:before{content:"\f086";}
.icon-thumbs-up-alt:before{content:"\f087";}
.icon-thumbs-down-alt:before{content:"\f088";}
.icon-star-half:before{content:"\f089";}
.icon-heart-empty:before{content:"\f08a";}
.icon-signout:before{content:"\f08b";}
.icon-linkedin-sign:before{content:"\f08c";}
.icon-pushpin:before{content:"\f08d";}
.icon-external-link:before{content:"\f08e";}
.icon-signin:before{content:"\f090";}
.icon-trophy:before{content:"\f091";}
.icon-github-sign:before{content:"\f092";}
.icon-upload-alt:before{content:"\f093";}
.icon-lemon:before{content:"\f094";}
.icon-phone:before{content:"\f095";}
.icon-unchecked:before,.icon-check-empty:before{content:"\f096";}
.icon-bookmark-empty:before{content:"\f097";}
.icon-phone-sign:before{content:"\f098";}
.icon-twitter:before{content:"\f099";}
.icon-facebook:before{content:"\f09a";}
.icon-github:before{content:"\f09b";}
.icon-unlock:before{content:"\f09c";}
.icon-credit-card:before{content:"\f09d";}
.icon-rss:before{content:"\f09e";}
.icon-hdd:before{content:"\f0a0";}
.icon-bullhorn:before{content:"\f0a1";}
.icon-bell:before{content:"\f0a2";}
.icon-certificate:before{content:"\f0a3";}
.icon-hand-right:before{content:"\f0a4";}
.icon-hand-left:before{content:"\f0a5";}
.icon-hand-up:before{content:"\f0a6";}
.icon-hand-down:before{content:"\f0a7";}
.icon-circle-arrow-left:before{content:"\f0a8";}
.icon-circle-arrow-right:before{content:"\f0a9";}
.icon-circle-arrow-up:before{content:"\f0aa";}
.icon-circle-arrow-down:before{content:"\f0ab";}
.icon-globe:before{content:"\f0ac";}
.icon-wrench:before{content:"\f0ad";}
.icon-tasks:before{content:"\f0ae";}
.icon-filter:before{content:"\f0b0";}
.icon-briefcase:before{content:"\f0b1";}
.icon-fullscreen:before{content:"\f0b2";}
.icon-group:before{content:"\f0c0";}
.icon-link:before{content:"\f0c1";}
.icon-cloud:before{content:"\f0c2";}
.icon-beaker:before{content:"\f0c3";}
.icon-cut:before{content:"\f0c4";}
.icon-copy:before{content:"\f0c5";}
.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";}
.icon-save:before{content:"\f0c7";}
.icon-sign-blank:before{content:"\f0c8";}
.icon-reorder:before{content:"\f0c9";}
.icon-list-ul:before{content:"\f0ca";}
.icon-list-ol:before{content:"\f0cb";}
.icon-strikethrough:before{content:"\f0cc";}
.icon-underline:before{content:"\f0cd";}
.icon-table:before{content:"\f0ce";}
.icon-magic:before{content:"\f0d0";}
.icon-truck:before{content:"\f0d1";}
.icon-pinterest:before{content:"\f0d2";}
.icon-pinterest-sign:before{content:"\f0d3";}
.icon-google-plus-sign:before{content:"\f0d4";}
.icon-google-plus:before{content:"\f0d5";}
.icon-money:before{content:"\f0d6";}
.icon-caret-down:before{content:"\f0d7";}
.icon-caret-up:before{content:"\f0d8";}
.icon-caret-left:before{content:"\f0d9";}
.icon-caret-right:before{content:"\f0da";}
.icon-columns:before{content:"\f0db";}
.icon-sort:before{content:"\f0dc";}
.icon-sort-down:before{content:"\f0dd";}
.icon-sort-up:before{content:"\f0de";}
.icon-envelope:before{content:"\f0e0";}
.icon-linkedin:before{content:"\f0e1";}
.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";}
.icon-legal:before{content:"\f0e3";}
.icon-dashboard:before{content:"\f0e4";}
.icon-comment-alt:before{content:"\f0e5";}
.icon-comments-alt:before{content:"\f0e6";}
.icon-bolt:before{content:"\f0e7";}
.icon-sitemap:before{content:"\f0e8";}
.icon-umbrella:before{content:"\f0e9";}
.icon-paste:before{content:"\f0ea";}
.icon-lightbulb:before{content:"\f0eb";}
.icon-exchange:before{content:"\f0ec";}
.icon-cloud-download:before{content:"\f0ed";}
.icon-cloud-upload:before{content:"\f0ee";}
.icon-user-md:before{content:"\f0f0";}
.icon-stethoscope:before{content:"\f0f1";}
.icon-suitcase:before{content:"\f0f2";}
.icon-bell-alt:before{content:"\f0f3";}
.icon-coffee:before{content:"\f0f4";}
.icon-food:before{content:"\f0f5";}
.icon-file-text-alt:before{content:"\f0f6";}
.icon-building:before{content:"\f0f7";}
.icon-hospital:before{content:"\f0f8";}
.icon-ambulance:before{content:"\f0f9";}
.icon-medkit:before{content:"\f0fa";}
.icon-fighter-jet:before{content:"\f0fb";}
.icon-beer:before{content:"\f0fc";}
.icon-h-sign:before{content:"\f0fd";}
.icon-plus-sign-alt:before{content:"\f0fe";}
.icon-double-angle-left:before{content:"\f100";}
.icon-double-angle-right:before{content:"\f101";}
.icon-double-angle-up:before{content:"\f102";}
.icon-double-angle-down:before{content:"\f103";}
.icon-angle-left:before{content:"\f104";}
.icon-angle-right:before{content:"\f105";}
.icon-angle-up:before{content:"\f106";}
.icon-angle-down:before{content:"\f107";}
.icon-desktop:before{content:"\f108";}
.icon-laptop:before{content:"\f109";}
.icon-tablet:before{content:"\f10a";}
.icon-mobile-phone:before{content:"\f10b";}
.icon-circle-blank:before{content:"\f10c";}
.icon-quote-left:before{content:"\f10d";}
.icon-quote-right:before{content:"\f10e";}
.icon-spinner:before{content:"\f110";}
.icon-circle:before{content:"\f111";}
.icon-mail-reply:before,.icon-reply:before{content:"\f112";}
.icon-github-alt:before{content:"\f113";}
.icon-folder-close-alt:before{content:"\f114";}
.icon-folder-open-alt:before{content:"\f115";}
.icon-expand-alt:before{content:"\f116";}
.icon-collapse-alt:before{content:"\f117";}
.icon-smile:before{content:"\f118";}
.icon-frown:before{content:"\f119";}
.icon-meh:before{content:"\f11a";}
.icon-gamepad:before{content:"\f11b";}
.icon-keyboard:before{content:"\f11c";}
.icon-flag-alt:before{content:"\f11d";}
.icon-flag-checkered:before{content:"\f11e";}
.icon-terminal:before{content:"\f120";}
.icon-code:before{content:"\f121";}
.icon-reply-all:before{content:"\f122";}
.icon-mail-reply-all:before{content:"\f122";}
.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
.icon-location-arrow:before{content:"\f124";}
.icon-crop:before{content:"\f125";}
.icon-code-fork:before{content:"\f126";}
.icon-unlink:before{content:"\f127";}
.icon-question:before{content:"\f128";}
.icon-info:before{content:"\f129";}
.icon-exclamation:before{content:"\f12a";}
.icon-superscript:before{content:"\f12b";}
.icon-subscript:before{content:"\f12c";}
.icon-eraser:before{content:"\f12d";}
.icon-puzzle-piece:before{content:"\f12e";}
.icon-microphone:before{content:"\f130";}
.icon-microphone-off:before{content:"\f131";}
.icon-shield:before{content:"\f132";}
.icon-calendar-empty:before{content:"\f133";}
.icon-fire-extinguisher:before{content:"\f134";}
.icon-rocket:before{content:"\f135";}
.icon-maxcdn:before{content:"\f136";}
.icon-chevron-sign-left:before{content:"\f137";}
.icon-chevron-sign-right:before{content:"\f138";}
.icon-chevron-sign-up:before{content:"\f139";}
.icon-chevron-sign-down:before{content:"\f13a";}
.icon-html5:before{content:"\f13b";}
.icon-css3:before{content:"\f13c";}
.icon-anchor:before{content:"\f13d";}
.icon-unlock-alt:before{content:"\f13e";}
.icon-bullseye:before{content:"\f140";}
.icon-ellipsis-horizontal:before{content:"\f141";}
.icon-ellipsis-vertical:before{content:"\f142";}
.icon-rss-sign:before{content:"\f143";}
.icon-play-sign:before{content:"\f144";}
.icon-ticket:before{content:"\f145";}
.icon-minus-sign-alt:before{content:"\f146";}
.icon-check-minus:before{content:"\f147";}
.icon-level-up:before{content:"\f148";}
.icon-level-down:before{content:"\f149";}
.icon-check-sign:before{content:"\f14a";}
.icon-edit-sign:before{content:"\f14b";}
.icon-external-link-sign:before{content:"\f14c";}
.icon-share-sign:before{content:"\f14d";}
.icon-compass:before{content:"\f14e";}
.icon-collapse:before{content:"\f150";}
.icon-collapse-top:before{content:"\f151";}
.icon-expand:before{content:"\f152";}
.icon-euro:before,.icon-eur:before{content:"\f153";}
.icon-gbp:before{content:"\f154";}
.icon-dollar:before,.icon-usd:before{content:"\f155";}
.icon-rupee:before,.icon-inr:before{content:"\f156";}
.icon-yen:before,.icon-jpy:before{content:"\f157";}
.icon-renminbi:before,.icon-cny:before{content:"\f158";}
.icon-won:before,.icon-krw:before{content:"\f159";}
.icon-bitcoin:before,.icon-btc:before{content:"\f15a";}
.icon-file:before{content:"\f15b";}
.icon-file-text:before{content:"\f15c";}
.icon-sort-by-alphabet:before{content:"\f15d";}
.icon-sort-by-alphabet-alt:before{content:"\f15e";}
.icon-sort-by-attributes:before{content:"\f160";}
.icon-sort-by-attributes-alt:before{content:"\f161";}
.icon-sort-by-order:before{content:"\f162";}
.icon-sort-by-order-alt:before{content:"\f163";}
.icon-thumbs-up:before{content:"\f164";}
.icon-thumbs-down:before{content:"\f165";}
.icon-youtube-sign:before{content:"\f166";}
.icon-youtube:before{content:"\f167";}
.icon-xing:before{content:"\f168";}
.icon-xing-sign:before{content:"\f169";}
.icon-youtube-play:before{content:"\f16a";}
.icon-dropbox:before{content:"\f16b";}
.icon-stackexchange:before{content:"\f16c";}
.icon-instagram:before{content:"\f16d";}
.icon-flickr:before{content:"\f16e";}
.icon-adn:before{content:"\f170";}
.icon-bitbucket:before{content:"\f171";}
.icon-bitbucket-sign:before{content:"\f172";}
.icon-tumblr:before{content:"\f173";}
.icon-tumblr-sign:before{content:"\f174";}
.icon-long-arrow-down:before{content:"\f175";}
.icon-long-arrow-up:before{content:"\f176";}
.icon-long-arrow-left:before{content:"\f177";}
.icon-long-arrow-right:before{content:"\f178";}
.icon-apple:before{content:"\f179";}
.icon-windows:before{content:"\f17a";}
.icon-android:before{content:"\f17b";}
.icon-linux:before{content:"\f17c";}
.icon-dribbble:before{content:"\f17d";}
.icon-skype:before{content:"\f17e";}
.icon-foursquare:before{content:"\f180";}
.icon-trello:before{content:"\f181";}
.icon-female:before{content:"\f182";}
.icon-male:before{content:"\f183";}
.icon-gittip:before{content:"\f184";}
.icon-sun:before{content:"\f185";}
.icon-moon:before{content:"\f186";}
.icon-archive:before{content:"\f187";}
.icon-bug:before{content:"\f188";}
.icon-vk:before{content:"\f189";}
.icon-weibo:before{content:"\f18a";}
.icon-renren:before{content:"\f18b";}

View File

@@ -0,0 +1,65 @@
.viewer {
-ms-touch-action: none;
}
.iviewer_common {
position:absolute;
bottom:10px;
border: 1px solid #000;
height: 28px;
z-index: 5000;
}
.iviewer_cursor {
cursor: url(../images/iviewer/hand.cur) 6 8, pointer;
}
.iviewer_drag_cursor {
cursor: url(../images/iviewer/grab.cur) 6 8, pointer;
}
.iviewer_button {
width: 28px;
cursor: pointer;
background-position: center center;
background-repeat: no-repeat;
}
.iviewer_zoom_in {
left: 20px;
background: url(../images/iviewer/iviewer.zoom_in.png);
}
.iviewer_zoom_out {
left: 55px;
background: url(../images/iviewer/iviewer.zoom_out.png);
}
.iviewer_zoom_zero {
left: 90px;
background: url(../images/iviewer/iviewer.zoom_zero.png);
}
.iviewer_zoom_fit {
left: 125px;
background: url(../images/iviewer/iviewer.zoom_fit.png);
}
.iviewer_zoom_status {
left: 160px;
font: 1em/28px Sans;
color: #000;
background-color: #fff;
text-align: center;
width: 60px;
}
.iviewer_rotate_left {
left: 227px;
background: #fff url(../images/iviewer/iviewer.rotate_left.png) center center no-repeat;
}
.iviewer_rotate_right {
left: 262px;
background: #fff url(../images/iviewer/iviewer.rotate_right.png) center center no-repeat;
}

View File

@@ -0,0 +1,3 @@
To modify your generated font, use the *dev.svg* file, located in the *fonts* folder in this package. You can import this dev.svg file to the IcoMoon app. All the tags (class names) and the Unicode points of your glyphs are saved in this file.
See the documentation for more info on how to use this package: http://icomoon.io/#docs/font-face

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG font generated by IcoMoon.
<iconset id="phpdocumentor-clean-icons" name="phpdocumentor-clean-icons" href="http://www.phpdoc.org" grid="16"></iconset><author name="Mike van Riel" href="http://www.mikevanriel.com"></author><license name="SIL"></license>
</metadata>
<defs>
<font id="phpdocumentor-clean-icons" horiz-adv-x="512" >
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
<glyph unicode="&#xe000;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 359.963,366.827 m0,0,0-43.124 -84.271,0 0-231.052 -50.246,0 0,231.052 -84.271,0 0,43.124 218.787,0" data-tags="trait" />
<glyph unicode="&#xe001;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 231.075,366.827 m0,0, 49.85,0 0-274.176 -49.85,0 0,274.176" data-tags="interface" />
<glyph unicode="&#xe002;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 278.749,86.717 m0,0,c -20.573,0 -39.036,3.165 -55.389,9.495 -16.353,6.33 -30.2,15.562 -41.542,27.695 -11.342,12.397 -20.046,27.431 -26.112,45.103 -6.066,17.672 -9.1,37.981 -9.1,60.928 0,22.947 3.429,43.256 10.287,60.928 7.121,17.672 16.749,32.574 28.881,44.707 12.133,12.396 26.376,21.76 42.729,28.090 16.353,6.33 33.893,9.495 52.62,9.495 11.341,0 21.628-0.923 30.86-2.769 9.231-1.583 17.276-3.429 24.134-5.539 6.857-2.11 12.528-4.352 17.012-6.726 4.484-2.374 7.649-4.089 9.495-5.143 l -14.639-40.751 c -6.33,3.956 -15.43,7.649 -27.299,11.078 -11.606,3.692 -24.266,5.539 -37.981,5.539 -11.869,0 -22.947-2.11 -33.233-6.33 -10.287-3.957 -19.254-10.023 -26.903-18.199 -7.385-8.177 -13.188-18.463 -17.408-30.86 -4.22-12.397 -6.33-26.772 -6.33-43.124 0-14.507 1.582-27.827 4.748-39.959 3.429-12.133 8.572-22.683 15.43-31.651 6.858-8.704 15.562-15.562 26.112-20.573 10.55-4.748 23.211-7.122 37.981-7.121 17.672,0 32.046,1.714 43.124,5.143 11.078,3.693 19.65,7.121 25.716,10.287 l 13.452-40.751 c -3.165-2.11 -7.517-4.22 -13.056-6.33 -5.275-2.11 -11.606-4.22 -18.991-6.33 -7.385-1.846 -15.694-3.297 -24.925-4.352 -9.232-1.319 -19.123-1.978 -29.673-1.978" data-tags="class" />
<glyph unicode="&#x20;" horiz-adv-x="256" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG font generated by IcoMoon.
<iconset id="phpdocumentor-clean-icons" name="phpdocumentor-clean-icons" href="http://www.phpdoc.org" grid="16"></iconset><author name="Mike van Riel" href="http://www.mikevanriel.com"></author><license name="SIL"></license>
</metadata>
<defs>
<font id="phpdocumentor-clean-icons" horiz-adv-x="512" >
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
<glyph unicode="&#xe000;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 359.963,366.827 m0,0,0-43.124 -84.271,0 0-231.052 -50.246,0 0,231.052 -84.271,0 0,43.124 218.787,0" />
<glyph unicode="&#xe001;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 231.075,366.827 m0,0, 49.85,0 0-274.176 -49.85,0 0,274.176" />
<glyph unicode="&#xe002;" d="M 139.636,456.727 C 75.171,456.727 23.273,404.829 23.273,340.364 l 0-232.727 c 0-64.465 51.898-116.364 116.364-116.364 l 232.727,0 c 64.465,0 116.364,51.898 116.364,116.364 L 488.727,340.364 C 488.727,404.829 436.829,456.727 372.364,456.727 L 139.636,456.727 z m 20.727-41.381 191.274,0 c 53.001,0 95.709-42.708 95.709-95.709 l 0-191.274 c 0-53.001 -42.708-95.709 -95.709-95.709 l -191.274,0 c -53.001,0 -95.709,42.708 -95.709,95.709 l 0,191.274 c 0,53.001 42.708,95.709 95.709,95.709 zM 278.749,86.717 m0,0,c -20.573,0 -39.036,3.165 -55.389,9.495 -16.353,6.33 -30.2,15.562 -41.542,27.695 -11.342,12.397 -20.046,27.431 -26.112,45.103 -6.066,17.672 -9.1,37.981 -9.1,60.928 0,22.947 3.429,43.256 10.287,60.928 7.121,17.672 16.749,32.574 28.881,44.707 12.133,12.396 26.376,21.76 42.729,28.090 16.353,6.33 33.893,9.495 52.62,9.495 11.341,0 21.628-0.923 30.86-2.769 9.231-1.583 17.276-3.429 24.134-5.539 6.857-2.11 12.528-4.352 17.012-6.726 4.484-2.374 7.649-4.089 9.495-5.143 l -14.639-40.751 c -6.33,3.956 -15.43,7.649 -27.299,11.078 -11.606,3.692 -24.266,5.539 -37.981,5.539 -11.869,0 -22.947-2.11 -33.233-6.33 -10.287-3.957 -19.254-10.023 -26.903-18.199 -7.385-8.177 -13.188-18.463 -17.408-30.86 -4.22-12.397 -6.33-26.772 -6.33-43.124 0-14.507 1.582-27.827 4.748-39.959 3.429-12.133 8.572-22.683 15.43-31.651 6.858-8.704 15.562-15.562 26.112-20.573 10.55-4.748 23.211-7.122 37.981-7.121 17.672,0 32.046,1.714 43.124,5.143 11.078,3.693 19.65,7.121 25.716,10.287 l 13.452-40.751 c -3.165-2.11 -7.517-4.22 -13.056-6.33 -5.275-2.11 -11.606-4.22 -18.991-6.33 -7.385-1.846 -15.694-3.297 -24.925-4.352 -9.232-1.319 -19.123-1.978 -29.673-1.978" />
<glyph unicode="&#x20;" horiz-adv-x="256" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,30 @@
/* Load this script using conditional IE comments if you need to support IE 7 and IE 6. */
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'phpdocumentor-clean-icons\'">' + entity + '</span>' + html;
}
var icons = {
'icon-trait' : '&#xe000;',
'icon-interface' : '&#xe001;',
'icon-class' : '&#xe002;'
},
els = document.getElementsByTagName('*'),
i, attr, html, c, el;
for (i = 0; ; i += 1) {
el = els[i];
if(!el) {
break;
}
attr = el.getAttribute('data-icon');
if (attr) {
addIcon(el, attr);
}
c = el.className;
c = c.match(/icon-[^\s'"]+/);
if (c && icons[c[0]]) {
addIcon(el, icons[c[0]]);
}
}
};

View File

@@ -0,0 +1,48 @@
@font-face {
font-family: 'phpdocumentor-clean-icons';
src:url('fonts/phpdocumentor-clean-icons.eot');
src:url('fonts/phpdocumentor-clean-icons.eot?#iefix') format('embedded-opentype'),
url('fonts/phpdocumentor-clean-icons.woff') format('woff'),
url('fonts/phpdocumentor-clean-icons.ttf') format('truetype'),
url('fonts/phpdocumentor-clean-icons.svg#phpdocumentor-clean-icons') format('svg');
font-weight: normal;
font-style: normal;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: 'phpdocumentor-clean-icons';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
/*
Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
[class*="icon-"] {
*/
.icon-trait, .icon-interface, .icon-class {
font-family: 'phpdocumentor-clean-icons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.icon-trait:before {
content: "\e000";
}
.icon-interface:before {
content: "\e001";
}
.icon-class:before {
content: "\e002";
}

204
docs/api/css/prism.css Normal file
View File

@@ -0,0 +1,204 @@
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0,0%,100%,.5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.regex,
.token.important {
color: #e90;
}
.token.important {
font-weight: bold;
}
.token.entity {
cursor: help;
}
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em; /* Same as .prisms padding-top */
background: hsla(24, 20%, 50%,.08);
background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
pointer-events: none;
line-height: inherit;
white-space: pre;
}
.line-highlight:before,
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
left: .6em;
min-width: 1em;
padding: 0 .5em;
background-color: hsla(24, 20%, 50%,.4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: .3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
pre.line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre.line-numbers > code {
position: relative;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
pointer-events: none;
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}

429
docs/api/css/template.css Normal file
View File

@@ -0,0 +1,429 @@
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro);
@import url('phpdocumentor-clean-icons/style.css');
body {
padding-top: 40px;
background-color: #333333;
}
a {
color: #6495ed;
}
a.anchor {
height: 40px;
margin-top: -40px;
display: block;
}
h1, h2, h3, h4, h5, h6, .brand {
font-family: 'Source Sans Pro', sans-serif;
font-weight: normal;
letter-spacing: 0.05em;
}
h2, h3, .detailsbar h1 {
overflow: hidden;
white-space: nowrap;
margin: 30px 0 20px 0;
}
h2:after, h3:after, .detailsbar h1:after {
content: '';
display: inline-block;
vertical-align: middle;
width: 100%;
height: 2px;
margin-left: 1em;
background: silver;
}
h3 {
margin: 10px 0 20px 0;
}
h4 {
margin: 20px 0 10px 0;
color: gray;
font-size: 18.5px;
}
h3.public, h3.protected, h3.private {
padding-left: 10px;
text-overflow: ellipsis;
}
.table tr:first-of-type th, .table tr:first-of-type td {
border-top: none;
}
.detailsbar {
color: #eeeeee;
background-color: #333333;
font-size: 0.9em;
overflow: hidden;
border-left: 2px solid gray;
}
.detailsbar h1 {
font-size: 1.5em;
margin-bottom: 20px;
margin-top: 0;
}
.detailsbar h2 {
font-size: 1.2em;
margin: 0;
padding: 0;
}
.detailsbar h1:after {
background: gray;
}
.detailsbar h2:after, .detailsbar h3:after {
background: transparent;
}
.detailsbar dt {
font-variant: small-caps;
text-transform: lowercase;
font-size: 1.1em;
letter-spacing: 0.1em;
color: silver;
}
.hierarchy div:nth-of-type(2) { margin-left: 11px; }
.hierarchy div:nth-of-type(3) { margin-left: 22px; }
.hierarchy div:nth-of-type(4) { margin-left: 33px; }
.hierarchy div:nth-of-type(5) { margin-left: 44px; }
.hierarchy div:nth-of-type(6) { margin-left: 55px; }
.hierarchy div:nth-of-type(7) { margin-left: 66px; }
.hierarchy div:nth-of-type(8) { margin-left: 77px; }
.hierarchy div:nth-of-type(9) { margin-left: 88px; }
.hierarchy div:before {
content: "\f0da";
font-family: FontAwesome;
margin-right: 5px;
}
.row-fluid {
background-color: white;
overflow: hidden;
}
footer.row-fluid, footer.row-fluid * {
background-color: #333333;
color: white;
}
footer.row-fluid {
border-top: 2px dashed #555;
margin-top: 2px;
}
.footer-sections .span4 {
border: 2px solid #555;
text-align: center;
border-radius: 10px;
margin-top: 70px;
margin-bottom: 20px;
background: #373737;
}
.footer-sections .span4 h1 {
background: transparent;
margin-top: -30px;
margin-bottom: 20px;
font-size: 5em;
}
.footer-sections .span4 h1 * {
background: transparent;
}
.footer-sections .span4 div {
border-bottom-right-radius: 6px;
border-bottom-left-radius: 6px;
padding: 10px;
min-height: 40px;
}
.footer-sections .span4 div, .footer-sections .span4 div * {
background-color: #555;
}
.footer-sections .span4 ul {
text-align: left;
list-style: none;
margin: 0;
padding: 0;
}
.content {
background-color: white;
padding-right: 20px;
}
.content nav {
text-align: center;
border-bottom: 1px solid silver;
margin: 5px 0 20px 0;
padding-bottom: 5px;
}
.content > h1 {
padding-bottom: 15px;
}
.content > h1 small {
display: block;
padding-bottom: 8px;
font-size: 0.6em;
}
.deprecated {
text-decoration: line-through;
}
.method {
margin-bottom: 20px;
}
.method .signature .argument {
color: maroon;
font-weight: bold;
}
.class #summary section.row-fluid {
overflow: hidden
}
.class #summary .heading {
font-weight: bold;
text-align: center;
}
.class #summary section .span4 {
padding: 3px;
overflow: hidden;
margin-bottom: -9999px;
padding-bottom: 9999px;
white-space: nowrap;
text-overflow: ellipsis;
border-left: 5px solid transparent;
}
.class #summary section.public .span4:first-of-type:before,
.class #summary section.public .span6:first-of-type:before,
h3.public:before {
font-family: FontAwesome;
content: "\f046";
color: green;
display: inline-block;
width: 1.2em;
}
.class #summary section .span4:first-of-type,
.class #summary section .span6:first-of-type {
padding-left: 21px;
}
.class #summary section .span4:first-of-type:before,
.class #summary section .span6:first-of-type:before {
margin-left: -21px;
}
.class #summary section.protected .span4:first-of-type:before,
.class #summary section.protected .span6:first-of-type:before,
h3.protected:before {
font-family: FontAwesome;
content: "\f132";
color: orange;
display: inline-block;
width: 1.2em;
}
.class #summary section.private .span4:first-of-type:before,
.class #summary section.private .span6:first-of-type:before,
h3.private:before {
font-family: FontAwesome;
content: "\f023";
color: red;
display: inline-block;
width: 1.2em;
}
.class #summary section em {
font-size: 0.9em;
color: silver;
}
.class #summary .inherited {
color: gray;
font-style: italic;
}
.accordion-group {
border: none;
}
.accordion {
margin-bottom: 0;
}
.accordion a:hover {
text-decoration: none;
background: #333333;
color: #eeeeee;
}
.accordion-heading .accordion-toggle:before {
content: "\f078";
font-family: FontAwesome;
margin-right: 5px;
}
.accordion-heading .accordion-toggle.collapsed:before {
content: "\f054";
}
.accordion-heading .accordion-toggle {
float: left;
width: 16px;
height: 16px;
padding: 4px 2px 4px 12px;
}
.accordion-heading a {
display: block;
padding: 4px 12px;
}
.accordion-inner a {
display: block;
padding: 4px 12px;
}
.accordion-inner > ul a:before {
font-family: 'phpdocumentor-clean-icons';
content: "\e001";
margin-right: 5px;
}
.accordion-inner li.class a:before {
content: "\e002";
}
.accordion-inner li.interface a:before {
content: "\e001";
}
.accordion-inner li.trait a:before {
content: "\e000";
}
.accordion-inner {
padding: 4px 0 4px 12px;
}
.accordion-inner ul {
list-style: none;
padding: 0;
margin: 0;
}
.row-fluid .span2 {
width: 16.5%;
}
body .modal {
width: 90%; /* desired relative width */
left: 5%; /* (100%-width)/2 */
/* place center */
margin-left:auto;
margin-right:auto;
}
.side-nav.nav-list li a {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@media (min-width: 767px) {
.sidebar {
position: fixed;
top: 40px;
bottom: 0;
background-color: #f3f3f3;
left: 0;
border-right: 1px solid #e9e9e9;
overflow-y: scroll;
overflow-x: hidden;
padding-top: 10px;
}
.sidebar::-webkit-scrollbar {
width: 10px;
}
.sidebar::-webkit-scrollbar-thumb {
background: #cccccc;
background-clip: padding-box;
border: 3px solid #f3f3f3;
border-radius: 5px;
}
.sidebar::-webkit-scrollbar-button {
display: none;
}
.sidebar::-webkit-scrollbar-track {
background: #f3f3f3;
}
}
@media (max-width: 979px) {
body {
padding-top: 0;
}
}
@media (max-width: 767px) {
.class #summary .heading {
display: none;
}
.detailsbar h1 {
display: none;
}
body {
background-color: white;
}
footer.row-fluid, footer.row-fluid * {
background-color: white;
}
.footer-sections .span4 h1 {
color: #ccccd9;
margin-top: 0;
}
.detailsbar {
background-color: white;
color: #333;
border: none;
}
.row-fluid .span2 {
width: 100%;
}
}
@media (min-width: 767px) {
.detailsbar {
min-height: 100%;
margin-bottom: -99999px;
padding-bottom: 99999px;
padding-left: 20px;
padding-top: 10px;
}
}
@media (min-width: 1200px) {
.row-fluid .span2 {
width: 16.5%;
}
}

View File

@@ -0,0 +1,257 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-306826089"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-306826089" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>CAsciiArt.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CAsciiArt.html">CAsciiArt</a></td>
<td><em>Create an ASCII version of an image.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/CAsciiArt.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,213 @@
<?php
/**
* Create an ASCII version of an image.
*
*/
class CAsciiArt
{
/**
* Character set to use.
*/
private $characterSet = array(
'one' => "#0XT|:,.' ",
'two' => "@%#*+=-:. ",
'three' => "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. "
);
/**
* Current character set.
*/
private $characters = null;
/**
* Length of current character set.
*/
private $charCount = null;
/**
* Scale of the area to swap to a character.
*/
private $scale = null;
/**
* Strategy to calculate luminance.
*/
private $luminanceStrategy = null;
/**
* Constructor which sets default options.
*/
public function __construct()
{
$this->setOptions();
}
/**
* Add a custom character set.
*
* @param string $key for the character set.
* @param string $value for the character set.
*
* @return $this
*/
public function addCharacterSet($key, $value)
{
$this->characterSet[$key] = $value;
return $this;
}
/**
* Set options for processing, defaults are available.
*
* @param array $options to use as default settings.
*
* @return $this
*/
public function setOptions($options = array())
{
$default = array(
"characterSet" => 'two',
"scale" => 14,
"luminanceStrategy" => 3,
"customCharacterSet" => null,
);
$default = array_merge($default, $options);
if (!is_null($default['customCharacterSet'])) {
$this->addCharacterSet('custom', $default['customCharacterSet']);
$default['characterSet'] = 'custom';
}
$this->scale = $default['scale'];
$this->characters = $this->characterSet[$default['characterSet']];
$this->charCount = strlen($this->characters);
$this->luminanceStrategy = $default['luminanceStrategy'];
return $this;
}
/**
* Create an Ascii image from an image file.
*
* @param string $filename of the image to use.
*
* @return string $ascii with the ASCII image.
*/
public function createFromFile($filename)
{
$img = imagecreatefromstring(file_get_contents($filename));
list($width, $height) = getimagesize($filename);
$ascii = null;
$incY = $this->scale;
$incX = $this->scale / 2;
for ($y = 0; $y < $height - 1; $y += $incY) {
for ($x = 0; $x < $width - 1; $x += $incX) {
$toX = min($x + $this->scale / 2, $width - 1);
$toY = min($y + $this->scale, $height - 1);
$luminance = $this->luminanceAreaAverage($img, $x, $y, $toX, $toY);
$ascii .= $this->luminance2character($luminance);
}
$ascii .= PHP_EOL;
}
return $ascii;
}
/**
* Get the luminance from a region of an image using average color value.
*
* @param string $img the image.
* @param integer $x1 the area to get pixels from.
* @param integer $y1 the area to get pixels from.
* @param integer $x2 the area to get pixels from.
* @param integer $y2 the area to get pixels from.
*
* @return integer $luminance with a value between 0 and 100.
*/
public function luminanceAreaAverage($img, $x1, $y1, $x2, $y2)
{
$numPixels = ($x2 - $x1 + 1) * ($y2 - $y1 + 1);
$luminance = 0;
for ($x = $x1; $x <= $x2; $x++) {
for ($y = $y1; $y <= $y2; $y++) {
$rgb = imagecolorat($img, $x, $y);
$red = (($rgb >> 16) & 0xFF);
$green = (($rgb >> 8) & 0xFF);
$blue = ($rgb & 0xFF);
$luminance += $this->getLuminance($red, $green, $blue);
}
}
return $luminance / $numPixels;
}
/**
* Calculate luminance value with different strategies.
*
* @param integer $red The color red.
* @param integer $green The color green.
* @param integer $blue The color blue.
*
* @return float $luminance with a value between 0 and 1.
*/
public function getLuminance($red, $green, $blue)
{
switch($this->luminanceStrategy) {
case 1:
$luminance = ($red * 0.2126 + $green * 0.7152 + $blue * 0.0722) / 255;
break;
case 2:
$luminance = ($red * 0.299 + $green * 0.587 + $blue * 0.114) / 255;
break;
case 3:
$luminance = sqrt(0.299 * pow($red, 2) + 0.587 * pow($green, 2) + 0.114 * pow($blue, 2)) / 255;
break;
case 0:
default:
$luminance = ($red + $green + $blue) / (255 * 3);
}
return $luminance;
}
/**
* Translate the luminance value to a character.
*
* @param string $position a value between 0-100 representing the
* luminance.
*
* @return string with the ascii character.
*/
public function luminance2character($luminance)
{
$position = (int) round($luminance * ($this->charCount - 1));
$char = $this->characters[$position];
return $char;
}
}

View File

@@ -0,0 +1,257 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1589006485"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1589006485" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>CHttpGet.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CHttpGet.html">CHttpGet</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/CHttpGet.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,291 @@
<?php
/**
* Get a image from a remote server using HTTP GET and If-Modified-Since.
*
*/
class CHttpGet
{
private $request = array();
private $response = array();
/**
* Constructor
*
*/
public function __construct()
{
$this->request['header'] = array();
}
/**
* Build an encoded url.
*
* @param string $baseUrl This is the original url which will be merged.
* @param string $merge Thse parts should be merged into the baseUrl,
* the format is as parse_url.
*
* @return string $url as the modified url.
*/
public function buildUrl($baseUrl, $merge)
{
$parts = parse_url($baseUrl);
$parts = array_merge($parts, $merge);
$url = $parts['scheme'];
$url .= "://";
$url .= $parts['host'];
$url .= isset($parts['port'])
? ":" . $parts['port']
: "" ;
$url .= $parts['path'];
return $url;
}
/**
* Set the url for the request.
*
* @param string $url
*
* @return $this
*/
public function setUrl($url)
{
$parts = parse_url($url);
$path = "";
if (isset($parts['path'])) {
$pathParts = explode('/', $parts['path']);
unset($pathParts[0]);
foreach ($pathParts as $value) {
$path .= "/" . rawurlencode($value);
}
}
$url = $this->buildUrl($url, array("path" => $path));
$this->request['url'] = $url;
return $this;
}
/**
* Set custom header field for the request.
*
* @param string $field
* @param string $value
*
* @return $this
*/
public function setHeader($field, $value)
{
$this->request['header'][] = "$field: $value";
return $this;
}
/**
* Set header fields for the request.
*
* @param string $field
* @param string $value
*
* @return $this
*/
public function parseHeader()
{
//$header = explode("\r\n", rtrim($this->response['headerRaw'], "\r\n"));
$rawHeaders = rtrim($this->response['headerRaw'], "\r\n");
# Handle multiple responses e.g. with redirections (proxies too)
$headerGroups = explode("\r\n\r\n", $rawHeaders);
# We're only interested in the last one
$header = explode("\r\n", end($headerGroups));
$output = array();
if ('HTTP' === substr($header[0], 0, 4)) {
list($output['version'], $output['status']) = explode(' ', $header[0]);
unset($header[0]);
}
foreach ($header as $entry) {
$pos = strpos($entry, ':');
$output[trim(substr($entry, 0, $pos))] = trim(substr($entry, $pos + 1));
}
$this->response['header'] = $output;
return $this;
}
/**
* Perform the request.
*
* @param boolean $debug set to true to dump headers.
*
* @throws Exception when curl fails to retrieve url.
*
* @return boolean
*/
public function doGet($debug = false)
{
$options = array(
CURLOPT_URL => $this->request['url'],
CURLOPT_HEADER => 1,
CURLOPT_HTTPHEADER => $this->request['header'],
CURLOPT_AUTOREFERER => true,
CURLOPT_RETURNTRANSFER => true,
CURLINFO_HEADER_OUT => $debug,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 5,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 2,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if (!$response) {
throw new Exception("Failed retrieving url, details follows: " . curl_error($ch));
}
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$this->response['headerRaw'] = substr($response, 0, $headerSize);
$this->response['body'] = substr($response, $headerSize);
$this->parseHeader();
if ($debug) {
$info = curl_getinfo($ch);
echo "Request header<br><pre>", var_dump($info['request_header']), "</pre>";
echo "Response header (raw)<br><pre>", var_dump($this->response['headerRaw']), "</pre>";
echo "Response header (parsed)<br><pre>", var_dump($this->response['header']), "</pre>";
}
curl_close($ch);
return true;
}
/**
* Get HTTP code of response.
*
* @return integer as HTTP status code or null if not available.
*/
public function getStatus()
{
return isset($this->response['header']['status'])
? (int) $this->response['header']['status']
: null;
}
/**
* Get file modification time of response.
*
* @return int as timestamp.
*/
public function getLastModified()
{
return isset($this->response['header']['Last-Modified'])
? strtotime($this->response['header']['Last-Modified'])
: null;
}
/**
* Get content type.
*
* @return string as the content type or null if not existing or invalid.
*/
public function getContentType()
{
$type = isset($this->response['header']['Content-Type'])
? $this->response['header']['Content-Type']
: null;
return preg_match('#[a-z]+/[a-z]+#', $type)
? $type
: null;
}
/**
* Get file modification time of response.
*
* @param mixed $default as default value (int seconds) if date is
* missing in response header.
*
* @return int as timestamp or $default if Date is missing in
* response header.
*/
public function getDate($default = false)
{
return isset($this->response['header']['Date'])
? strtotime($this->response['header']['Date'])
: $default;
}
/**
* Get max age of cachable item.
*
* @param mixed $default as default value if date is missing in response
* header.
*
* @return int as timestamp or false if not available.
*/
public function getMaxAge($default = false)
{
$cacheControl = isset($this->response['header']['Cache-Control'])
? $this->response['header']['Cache-Control']
: null;
$maxAge = null;
if ($cacheControl) {
// max-age=2592000
$part = explode('=', $cacheControl);
$maxAge = ($part[0] == "max-age")
? (int) $part[1]
: null;
}
if ($maxAge) {
return $maxAge;
}
$expire = isset($this->response['header']['Expires'])
? strtotime($this->response['header']['Expires'])
: null;
return $expire ? $expire : $default;
}
/**
* Get body of response.
*
* @return string as body.
*/
public function getBody()
{
return $this->response['body'];
}
}

257
docs/api/files/CImage.html Normal file
View File

@@ -0,0 +1,257 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1494355388"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1494355388" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>CImage.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CImage.html">CImage</a></td>
<td><em>Resize and crop images on the fly, store generated images in a cache.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/CImage.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1879794739"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1879794739" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>CRemoteImage.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CRemoteImage.html">CRemoteImage</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/CRemoteImage.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,311 @@
<?php
/**
* Get a image from a remote server using HTTP GET and If-Modified-Since.
*
*/
class CRemoteImage
{
/**
* Path to cache files.
*/
private $saveFolder = null;
/**
* Use cache or not.
*/
private $useCache = true;
/**
* HTTP object to aid in download file.
*/
private $http;
/**
* Status of the HTTP request.
*/
private $status;
/**
* Defalt age for cached items 60*60*24*7.
*/
private $defaultMaxAge = 604800;
/**
* Url of downloaded item.
*/
private $url;
/**
* Base name of cache file for downloaded item and name of image.
*/
private $fileName;
/**
* Filename for json-file with details of cached item.
*/
private $fileJson;
/**
* Cache details loaded from file.
*/
private $cache;
/**
* Get status of last HTTP request.
*
* @return int as status
*/
public function getStatus()
{
return $this->status;
}
/**
* Get JSON details for cache item.
*
* @return array with json details on cache.
*/
public function getDetails()
{
return $this->cache;
}
/**
* Set the path to the cache directory.
*
* @param boolean $use true to use the cache and false to ignore cache.
*
* @return $this
*/
public function setCache($path)
{
$this->saveFolder = $path;
return $this;
}
/**
* Check if cache is writable or throw exception.
*
* @return $this
*
* @throws Exception if cahce folder is not writable.
*/
public function isCacheWritable()
{
if (!is_writable($this->saveFolder)) {
throw new Exception("Cache folder is not writable for downloaded files.");
}
return $this;
}
/**
* Decide if the cache should be used or not before trying to download
* a remote file.
*
* @param boolean $use true to use the cache and false to ignore cache.
*
* @return $this
*/
public function useCache($use = true)
{
$this->useCache = $use;
return $this;
}
/**
* Set header fields.
*
* @return $this
*/
public function setHeaderFields()
{
$this->http->setHeader("User-Agent", "CImage/0.7.2 (PHP/". phpversion() . " cURL)");
$this->http->setHeader("Accept", "image/jpeg,image/png,image/gif");
if ($this->useCache) {
$this->http->setHeader("Cache-Control", "max-age=0");
} else {
$this->http->setHeader("Cache-Control", "no-cache");
$this->http->setHeader("Pragma", "no-cache");
}
}
/**
* Save downloaded resource to cache.
*
* @return string as path to saved file or false if not saved.
*/
public function save()
{
$this->cache = array();
$date = $this->http->getDate(time());
$maxAge = $this->http->getMaxAge($this->defaultMaxAge);
$lastModified = $this->http->getLastModified();
$type = $this->http->getContentType();
$this->cache['Date'] = gmdate("D, d M Y H:i:s T", $date);
$this->cache['Max-Age'] = $maxAge;
$this->cache['Content-Type'] = $type;
$this->cache['Url'] = $this->url;
if ($lastModified) {
$this->cache['Last-Modified'] = gmdate("D, d M Y H:i:s T", $lastModified);
}
// Save only if body is a valid image
$body = $this->http->getBody();
$img = imagecreatefromstring($body);
if ($img !== false) {
file_put_contents($this->fileName, $body);
file_put_contents($this->fileJson, json_encode($this->cache));
return $this->fileName;
}
return false;
}
/**
* Got a 304 and updates cache with new age.
*
* @return string as path to cached file.
*/
public function updateCacheDetails()
{
$date = $this->http->getDate(time());
$maxAge = $this->http->getMaxAge($this->defaultMaxAge);
$lastModified = $this->http->getLastModified();
$this->cache['Date'] = gmdate("D, d M Y H:i:s T", $date);
$this->cache['Max-Age'] = $maxAge;
if ($lastModified) {
$this->cache['Last-Modified'] = gmdate("D, d M Y H:i:s T", $lastModified);
}
file_put_contents($this->fileJson, json_encode($this->cache));
return $this->fileName;
}
/**
* Download a remote file and keep a cache of downloaded files.
*
* @param string $url a remote url.
*
* @throws Exception when status code does not match 200 or 304.
*
* @return string as path to downloaded file or false if failed.
*/
public function download($url)
{
$this->http = new CHttpGet();
$this->url = $url;
// First check if the cache is valid and can be used
$this->loadCacheDetails();
if ($this->useCache) {
$src = $this->getCachedSource();
if ($src) {
$this->status = 1;
return $src;
}
}
// Do a HTTP request to download item
$this->setHeaderFields();
$this->http->setUrl($this->url);
$this->http->doGet();
$this->status = $this->http->getStatus();
if ($this->status === 200) {
$this->isCacheWritable();
return $this->save();
} elseif ($this->status === 304) {
$this->isCacheWritable();
return $this->updateCacheDetails();
}
throw new Exception("Unknown statuscode when downloading remote image: " . $this->status);
}
/**
* Get the path to the cached image file if the cache is valid.
*
* @return $this
*/
public function loadCacheDetails()
{
$cacheFile = md5($this->url);
$this->fileName = $this->saveFolder . $cacheFile;
$this->fileJson = $this->fileName . ".json";
if (is_readable($this->fileJson)) {
$this->cache = json_decode(file_get_contents($this->fileJson), true);
}
}
/**
* Get the path to the cached image file if the cache is valid.
*
* @return string as the path ot the image file or false if no cache.
*/
public function getCachedSource()
{
$imageExists = is_readable($this->fileName);
// Is cache valid?
$date = strtotime($this->cache['Date']);
$maxAge = $this->cache['Max-Age'];
$now = time();
if ($imageExists && $date + $maxAge > $now) {
return $this->fileName;
}
// Prepare for a 304 if available
if ($imageExists && isset($this->cache['Last-Modified'])) {
$this->http->setHeader("If-Modified-Since", $this->cache['Last-Modified']);
}
return false;
}
}

View File

@@ -0,0 +1,257 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1920829892"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1920829892" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>CWhitelist.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CWhitelist.html">CWhitelist</a></td>
<td><em>Act as whitelist (or blacklist).</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/CWhitelist.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,63 @@
<?php
/**
* Act as whitelist (or blacklist).
*
*/
class CWhitelist
{
/**
* Array to contain the whitelist options.
*/
private $whitelist = array();
/**
* Set the whitelist from an array of strings, each item in the
* whitelist should be a regexp without the surrounding / or #.
*
* @param array $whitelist with all valid options,
* default is to clear the whitelist.
*
* @return $this
*/
public function set($whitelist = array())
{
if (!is_array($whitelist)) {
throw new Exception("Whitelist is not of a supported format.");
}
$this->whitelist = $whitelist;
return $this;
}
/**
* Check if item exists in the whitelist.
*
* @param string $item string to check.
* @param array $whitelist optional with all valid options, default is null.
*
* @return boolean true if item is in whitelist, else false.
*/
public function check($item, $whitelist = null)
{
if ($whitelist !== null) {
$this->set($whitelist);
}
if (empty($item) or empty($this->whitelist)) {
return false;
}
foreach ($this->whitelist as $regexp) {
if (preg_match("#$regexp#", $item)) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,250 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-105414451"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-105414451" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>autoload.php</h1>
<p><em>Autoloader for CImage and related class files.</em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/autoload.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Autoloader for CImage and related class files.
*
*/
//include __DIR__ . "/../CHttpGet.php";
//include __DIR__ . "/../CRemoteImage.php";
//include __DIR__ . "/../CImage.php";
/**
* Autoloader for classes.
*
* @param string $class the fully-qualified class name.
*
* @return void
*/
spl_autoload_register(function ($class) {
//$path = CIMAGE_SOURCE_PATH . "/{$class}.php";
$path = __DIR__ . "/{$class}.php";
if (is_file($path)) {
require($path);
}
});

View File

@@ -0,0 +1,166 @@
<?php
/**
* A testclass
*
*/
class CImage_RemoteDownloadTest extends \PHPUnit_Framework_TestCase
{
/*
* remote_whitelist
*/
private $remote_whitelist = [
'\.facebook\.com$',
'^(?:images|photos-[a-z])\.ak\.instagram\.com$',
'\.google\.com$',
];
/**
* Provider for valid remote sources.
*
* @return array
*/
public function providerValidRemoteSource()
{
return [
[
"http://dbwebb.se/img.jpg",
"https://dbwebb.se/img.jpg",
],
];
}
/**
* Provider for invalid remote sources.
*
* @return array
*/
public function providerInvalidRemoteSource()
{
return [
[
"ftp://dbwebb.se/img.jpg",
"dbwebb.se/img.jpg",
"img.jpg",
],
];
}
/**
* Test
*
* @return void
*
* @dataProvider providerValidRemoteSource
*/
public function testAllowRemoteDownloadDefaultPatternValid($source)
{
$img = new CImage();
$img->setRemoteDownload(true);
$res = $img->isRemoteSource($source);
$this->assertTrue($res, "Should be a valid remote source: '$source'.");
}
/**
* Test
*
* @return void
*
* @dataProvider providerInvalidRemoteSource
*/
public function testAllowRemoteDownloadDefaultPatternInvalid($source)
{
$img = new CImage();
$img->setRemoteDownload(true);
$res = $img->isRemoteSource($source);
$this->assertFalse($res, "Should not be a valid remote source: '$source'.");
}
/**
* Provider for hostname matching the whitelist.
*
* @return array
*/
public function providerHostnameMatch()
{
return [
[
"any.facebook.com",
"images.ak.instagram.com",
"google.com",
],
];
}
/**
* Test
*
* @param string $hostname matches the whitelist
*
* @return void
*
* @dataProvider providerHostnameMatch
*
*/
public function testRemoteHostWhitelistMatch($hostname)
{
$img = new CImage();
$img->setRemoteHostWhitelist($this->remote_whitelist);
$res = $img->isRemoteSourceOnWhitelist("http://$hostname/img.jpg");
$this->assertTrue($res, "Should be a valid hostname on the whitelist: '$hostname'.");
}
/**
* Provider for hostname not matching the whitelist.
*
* @return array
*/
public function providerHostnameNoMatch()
{
return [
[
"example.com",
".com",
"img.jpg",
],
];
}
/**
* Test
*
* @param string $hostname not matching the whitelist
*
* @return void
*
* @dataProvider providerHostnameNoMatch
*
*/
public function testRemoteHostWhitelistNoMatch($hostname)
{
$img = new CImage();
$img->setRemoteHostWhitelist($this->remote_whitelist);
$res = $img->isRemoteSourceOnWhitelist("http://$hostname/img.jpg");
$this->assertFalse($res, "Should not be a valid hostname on the whitelist: '$hostname'.");
}
}

View File

@@ -0,0 +1,95 @@
<?php
/**
* A testclass
*
*/
class CWhitelistTest extends \PHPUnit_Framework_TestCase
{
/*
* remote_whitelist
*/
private $remote_whitelist = [
'\.facebook\.com$',
'^(?:images|photos-[a-z])\.ak\.instagram\.com$',
'\.google\.com$',
];
/**
* Provider for hostname matching the whitelist.
*
* @return array
*/
public function providerHostnameMatch()
{
return [
[
"any.facebook.com",
"images.ak.instagram.com",
"google.com",
],
];
}
/**
* Provider for hostname not matching the whitelist.
*
* @return array
*/
public function providerHostnameNoMatch()
{
return [
[
"example.com",
".com",
"img.jpg",
],
];
}
/**
* Test
*
* @param string $hostname matches the whitelist
*
* @return void
*
* @dataProvider providerHostnameMatch
*
*/
public function testRemoteHostWhitelistMatch($hostname)
{
$whitelist = new CWhitelist();
$whitelist->set($this->remote_whitelist);
$res = $whitelist->check($hostname);
$this->assertTrue($res, "Should be a valid hostname on the whitelist: '$hostname'.");
}
/**
* Test
*
* @param string $hostname not matching the whitelist
*
* @return void
*
* @dataProvider providerHostnameNoMatch
*
*/
public function testRemoteHostWhitelistNoMatch($hostname)
{
$whitelist = new CWhitelist();
$whitelist->set($this->remote_whitelist);
$res = $whitelist->check($hostname);
$this->assertFalse($res, "Should not be a valid hostname on the whitelist: '$hostname'.");
}
}

View File

@@ -0,0 +1,7 @@
<?php
/**
* Get all configuration details to be able to execute the test suite.
*
*/
require __DIR__ . "/../autoload.php";

View File

@@ -0,0 +1,267 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-265146745"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-265146745" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>test</small>CImage_RemoteDownloadTest.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></td>
<td><em>A testclass</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/test/CImage_RemoteDownloadTest.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,267 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-372562288"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-372562288" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>test</small>CWhitelistTest.php</h1>
<p><em></em></p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></td>
<td><em>A testclass</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/test/CWhitelistTest.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1069179048"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1069179048" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>test</small>config.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/test/config.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<?php
echo 'Current PHP version: ' . phpversion() . '<br><br>';
echo 'Running on: ' . $_SERVER['SERVER_SOFTWARE'] . '<br><br>';
$no = extension_loaded('gd') ? null : 'NOT';
echo "Extension gd is $no loaded.<br>";
$no = extension_loaded('exif') ? null : 'NOT';
echo "Extension exif is $no loaded.<br>";
if (!$no) {
echo "<pre>", var_dump(gd_info()), "</pre>";
}

View File

@@ -0,0 +1,13 @@
<?php
$script = <<<EOD
CImage.compare({
"input1": "../img.php?src=car.png",
"input2": "../img.php?src=car.png&sharpen",
"input3": "../img.php?src=car.png&blur",
"input4": "../img.php?src=car.png&emboss",
"json": true,
"stack": false
});
EOD;
include __DIR__ . "/compare.php";

View File

@@ -0,0 +1,107 @@
<!doctype html>
<html lang=en>
<head>
<style>
body {
}
input[type=text] {
width: 400px;
}
.hidden {
display: none;
}
#wrap {
position: relative;
overflow: visible;
}
.stack {
position: absolute;
left: 0;
top: 0;
}
.area {
float: left;
padding: 1em;
background-color: #fff;
}
.top {
z-index: 10;
}
</style>
</head>
<body>
<h1>Compare images</h1>
<p>Add link to images and visually compare them. Change the link och press return to load the image. <a href="http://dbwebb.se/opensource/cimage">Read more...</a></p>
<form>
<p>
<label>Image 1: <input type="text" id="input1" data-id="1"></label> <img id="thumb1"></br>
<label>Image 2: <input type="text" id="input2" data-id="2"></label> <img id="thumb2"></br>
<label>Image 3: <input type="text" id="input3" data-id="3"></label> <img id="thumb3"></br>
<label>Image 4: <input type="text" id="input4" data-id="4"></label> <img id="thumb4"></br>
<label><input type="checkbox" id="viewDetails">Hide image details?</label><br/>
<label><input type="checkbox" id="stack">Stack images?</label>
</p>
</form>
<div id="buttonWrap" class="hidden">
<button id="button1" class="button" data-id="1">Image 1</button>
<button id="button2" class="button" data-id="2">Image 2</button>
<button id="button3" class="button" data-id="3">Image 3</button>
<button id="button4" class="button" data-id="4">Image 4</button>
</div>
<div id="wrap">
<div id="area1" class="area">
<code>Image 1</code><br>
<img id="img1">
<pre id="json1" class="json"></pre>
</div>
<div id="area2" class="area">
<code>Image 2</code><br>
<img id="img2">
<pre id="json2" class="json"></pre>
</div>
<div id="area3" class="area">
<code>Image 3</code><br>
<img id="img3">
<pre id="json3" class="json"></pre>
</div>
<div id="area4" class="area">
<code>Image 4</code><br>
<img id="img4">
<pre id="json4" class="json"></pre>
</div>
</div>
</body>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="../js/cimage.js"></script>
<script>
<?php
if (isset($script)) {
echo $script;
} else {
echo "CImage.compare({});";
} ?>
</script>
</html>

View File

@@ -0,0 +1,916 @@
<?php
/**
* Resize and crop images on the fly, store generated images in a cache.
*
* @author Mikael Roos mos@dbwebb.se
* @example http://dbwebb.se/opensource/cimage
* @link https://github.com/mosbth/cimage
*
*/
$version = "v0.7.0.x (latest)";
/**
* Default configuration options, can be overridden in own config-file.
*
* @param string $msg to display.
*
* @return void
*/
function errorPage($msg)
{
global $mode;
header("HTTP/1.0 500 Internal Server Error");
if ($mode == 'development') {
die("[img.php] $msg");
} else {
error_log("[img.php] $msg");
die("HTTP/1.0 500 Internal Server Error");
}
}
/**
* Custom exception handler.
*/
set_exception_handler(function ($exception) {
errorPage("<p><b>img.php: Uncaught exception:</b> <p>" . $exception->getMessage() . "</p><pre>" . $exception->getTraceAsString(), "</pre>");
});
/**
* Get input from query string or return default value if not set.
*
* @param mixed $key as string or array of string values to look for in $_GET.
* @param mixed $default value to return when $key is not set in $_GET.
*
* @return mixed value from $_GET or default value.
*/
function get($key, $default = null)
{
if (is_array($key)) {
foreach ($key as $val) {
if (isset($_GET[$val])) {
return $_GET[$val];
}
}
} elseif (isset($_GET[$key])) {
return $_GET[$key];
}
return $default;
}
/**
* Get input from query string and set to $defined if defined or else $undefined.
*
* @param mixed $key as string or array of string values to look for in $_GET.
* @param mixed $defined value to return when $key is set in $_GET.
* @param mixed $undefined value to return when $key is not set in $_GET.
*
* @return mixed value as $defined or $undefined.
*/
function getDefined($key, $defined, $undefined)
{
return get($key) === null ? $undefined : $defined;
}
/**
* Get value from config array or default if key is not set in config array.
*
* @param string $key the key in the config array.
* @param mixed $default value to be default if $key is not set in config.
*
* @return mixed value as $config[$key] or $default.
*/
function getConfig($key, $default)
{
global $config;
return isset($config[$key])
? $config[$key]
: $default;
}
/**
* Log when verbose mode, when used without argument it returns the result.
*
* @param string $msg to log.
*
* @return void or array.
*/
function verbose($msg = null)
{
global $verbose;
static $log = array();
if (!$verbose) {
return;
}
if (is_null($msg)) {
return $log;
}
$log[] = $msg;
}
/**
* Get configuration options from file, if the file exists, else use $config
* if its defined or create an empty $config.
*/
$configFile = __DIR__.'/'.basename(__FILE__, '.php').'_config.php';
if (is_file($configFile)) {
$config = require $configFile;
} else if (!isset($config)) {
$config = array();
}
/**
* verbose, v - do a verbose dump of what happens
*/
$verbose = getDefined(array('verbose', 'v'), true, false);
verbose("img.php version = $version");
/**
* Set mode as strict, production or development.
* Default is production environment.
*/
$mode = getConfig('mode', 'production');
// Settings for any mode
set_time_limit(20);
ini_set('gd.jpeg_ignore_warning', 1);
if (!extension_loaded('gd')) {
errorPage("Extension gd is nod loaded.");
}
// Specific settings for each mode
if ($mode == 'strict') {
error_reporting(0);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
$verbose = false;
} else if ($mode == 'production') {
error_reporting(-1);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
$verbose = false;
} else if ($mode == 'development') {
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('log_errors', 0);
} else {
errorPage("Unknown mode: $mode");
}
verbose("mode = $mode");
verbose("error log = " . ini_get('error_log'));
/**
* Set default timezone if not set or if its set in the config-file.
*/
$defaultTimezone = getConfig('default_timezone', null);
if ($defaultTimezone) {
date_default_timezone_set($defaultTimezone);
} else if (!ini_get('default_timezone')) {
date_default_timezone_set('UTC');
}
/**
* Check if passwords are configured, used and match.
* Options decide themself if they require passwords to be used.
*/
$pwdConfig = getConfig('password', false);
$pwdAlways = getConfig('password_always', false);
$pwd = get(array('password', 'pwd'), null);
// Check if passwords match, if configured to use passwords
$passwordMatch = null;
if ($pwdAlways) {
$passwordMatch = ($pwdConfig === $pwd);
if (!$passwordMatch) {
errorPage("Password required and does not match or exists.");
}
} elseif ($pwdConfig && $pwd) {
$passwordMatch = ($pwdConfig === $pwd);
}
verbose("password match = $passwordMatch");
/**
* Prevent hotlinking, leeching, of images by controlling who access them
* from where.
*
*/
$allowHotlinking = getConfig('allow_hotlinking', true);
$hotlinkingWhitelist = getConfig('hotlinking_whitelist', array());
$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null;
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
$refererHost = parse_url($referer, PHP_URL_HOST);
if (!$allowHotlinking) {
if ($passwordMatch) {
; // Always allow when password match
} else if ($passwordMatch === false) {
errorPage("Hotlinking/leeching not allowed when password missmatch.");
} else if (!$referer) {
errorPage("Hotlinking/leeching not allowed and referer is missing.");
} else if (strcmp($serverName, $refererHost) == 0) {
; // Allow when serverName matches refererHost
} else if (!empty($hotlinkingWhitelist)) {
$allowedByWhitelist = false;
foreach ($hotlinkingWhitelist as $val) {
if (preg_match($val, $refererHost)) {
$allowedByWhitelist = true;
}
}
if (!$allowedByWhitelist) {
errorPage("Hotlinking/leeching not allowed by whitelist.");
}
} else {
errorPage("Hotlinking/leeching not allowed.");
}
}
verbose("allow_hotlinking = $allowHotlinking");
verbose("referer = $referer");
verbose("referer host = $refererHost");
/**
* Get the source files.
*/
$autoloader = getConfig('autoloader', false);
$cimageClass = getConfig('cimage_class', false);
if ($autoloader) {
require $autoloader;
} else if ($cimageClass) {
require $cimageClass;
}
/**
* Create the class for the image.
*/
$img = new CImage();
$img->setVerbose($verbose);
/**
* Allow or disallow remote download of images from other servers.
* Passwords apply if used.
*
*/
$allowRemote = getConfig('remote_allow', false);
if ($allowRemote && $passwordMatch !== false) {
$pattern = getConfig('remote_pattern', null);
$img->setRemoteDownload($allowRemote, $pattern);
$whitelist = getConfig('remote_whitelist', null);
$img->setRemoteHostWhitelist($whitelist);
}
/**
* shortcut, sc - extend arguments with a constant value, defined
* in config-file.
*/
$shortcut = get(array('shortcut', 'sc'), null);
$shortcutConfig = getConfig('shortcut', array(
'sepia' => "&f=grayscale&f0=brightness,-10&f1=contrast,-20&f2=colorize,120,60,0,0&sharpen",
));
verbose("shortcut = $shortcut");
if (isset($shortcut)
&& isset($shortcutConfig[$shortcut])) {
parse_str($shortcutConfig[$shortcut], $get);
verbose("shortcut-constant = {$shortcutConfig[$shortcut]}");
$_GET = array_merge($_GET, $get);
}
/**
* src - the source image file.
*/
$srcImage = get('src')
or errorPage('Must set src-attribute.');
// Check for valid/invalid characters
$imagePath = getConfig('image_path', __DIR__ . '/img/');
$imagePathConstraint = getConfig('image_path_constraint', true);
$validFilename = getConfig('valid_filename', '#^[a-z0-9A-Z-/_\.:]+$#');
preg_match($validFilename, $srcImage)
or errorPage('Filename contains invalid characters.');
if ($allowRemote && $img->isRemoteSource($srcImage)) {
// If source is a remote file, ignore local file checks.
} else if ($imagePathConstraint) {
// Check that the image is a file below the directory 'image_path'.
$pathToImage = realpath($imagePath . $srcImage);
$imageDir = realpath($imagePath);
is_file($pathToImage)
or errorPage(
'Source image is not a valid file, check the filename and that a
matching file exists on the filesystem.'
);
substr_compare($imageDir, $pathToImage, 0, strlen($imageDir)) == 0
or errorPage(
'Security constraint: Source image is not below the directory "image_path"
as specified in the config file img_config.php.'
);
}
verbose("src = $srcImage");
/**
* Manage size constants from config file, use constants to replace values
* for width and height.
*/
$sizeConstant = getConfig('size_constant', function () {
// Set sizes to map constant to value, easier to use with width or height
$sizes = array(
'w1' => 613,
'w2' => 630,
);
// Add grid column width, useful for use as predefined size for width (or height).
$gridColumnWidth = 30;
$gridGutterWidth = 10;
$gridColumns = 24;
for ($i = 1; $i <= $gridColumns; $i++) {
$sizes['c' . $i] = ($gridColumnWidth + $gridGutterWidth) * $i - $gridGutterWidth;
}
return $sizes;
});
$sizes = call_user_func($sizeConstant);
/**
* width, w - set target width, affecting the resulting image width, height and resize options
*/
$newWidth = get(array('width', 'w'));
$maxWidth = getConfig('max_width', 2000);
// Check to replace predefined size
if (isset($sizes[$newWidth])) {
$newWidth = $sizes[$newWidth];
}
// Support width as % of original width
if ($newWidth[strlen($newWidth)-1] == '%') {
is_numeric(substr($newWidth, 0, -1))
or errorPage('Width % not numeric.');
} else {
is_null($newWidth)
or ($newWidth > 10 && $newWidth <= $maxWidth)
or errorPage('Width out of range.');
}
verbose("new width = $newWidth");
/**
* height, h - set target height, affecting the resulting image width, height and resize options
*/
$newHeight = get(array('height', 'h'));
$maxHeight = getConfig('max_height', 2000);
// Check to replace predefined size
if (isset($sizes[$newHeight])) {
$newHeight = $sizes[$newHeight];
}
// height
if ($newHeight[strlen($newHeight)-1] == '%') {
is_numeric(substr($newHeight, 0, -1))
or errorPage('Height % out of range.');
} else {
is_null($newHeight)
or ($newHeight > 10 && $newHeight <= $maxHeight)
or errorPage('Hight out of range.');
}
verbose("new height = $newHeight");
/**
* aspect-ratio, ar - affecting the resulting image width, height and resize options
*/
$aspectRatio = get(array('aspect-ratio', 'ar'));
$aspectRatioConstant = getConfig('aspect_ratio_constant', function () {
return array(
'3:1' => 3/1,
'3:2' => 3/2,
'4:3' => 4/3,
'8:5' => 8/5,
'16:10' => 16/10,
'16:9' => 16/9,
'golden' => 1.618,
);
});
// Check to replace predefined aspect ratio
$aspectRatios = call_user_func($aspectRatioConstant);
$negateAspectRatio = ($aspectRatio[0] == '!') ? true : false;
$aspectRatio = $negateAspectRatio ? substr($aspectRatio, 1) : $aspectRatio;
if (isset($aspectRatios[$aspectRatio])) {
$aspectRatio = $aspectRatios[$aspectRatio];
}
if ($negateAspectRatio) {
$aspectRatio = 1 / $aspectRatio;
}
is_null($aspectRatio)
or is_numeric($aspectRatio)
or errorPage('Aspect ratio out of range');
verbose("aspect ratio = $aspectRatio");
/**
* crop-to-fit, cf - affecting the resulting image width, height and resize options
*/
$cropToFit = getDefined(array('crop-to-fit', 'cf'), true, false);
verbose("crop to fit = $cropToFit");
/**
* Set default background color from config file.
*/
$backgroundColor = getConfig('background_color', null);
if ($backgroundColor) {
$img->setDefaultBackgroundColor($backgroundColor);
verbose("Using default background_color = $backgroundColor");
}
/**
* bgColor - Default background color to use
*/
$bgColor = get(array('bgColor', 'bg-color', 'bgc'), null);
verbose("bgColor = $bgColor");
/**
* fill-to-fit, ff - affecting the resulting image width, height and resize options
*/
$fillToFit = get(array('fill-to-fit', 'ff'), null);
verbose("fill-to-fit = $fillToFit");
if ($fillToFit !== null) {
if (!empty($fillToFit)) {
$bgColor = $fillToFit;
verbose("fillToFit changed bgColor to = $bgColor");
}
$fillToFit = true;
verbose("fill-to-fit (fixed) = $fillToFit");
}
/**
* no-ratio, nr, stretch - affecting the resulting image width, height and resize options
*/
$keepRatio = getDefined(array('no-ratio', 'nr', 'stretch'), false, true);
verbose("keep ratio = $keepRatio");
/**
* crop, c - affecting the resulting image width, height and resize options
*/
$crop = get(array('crop', 'c'));
verbose("crop = $crop");
/**
* area, a - affecting the resulting image width, height and resize options
*/
$area = get(array('area', 'a'));
verbose("area = $area");
/**
* skip-original, so - skip the original image and always process a new image
*/
$useOriginal = getDefined(array('skip-original', 'so'), false, true);
verbose("use original = $useOriginal");
/**
* no-cache, nc - skip the cached version and process and create a new version in cache.
*/
$useCache = getDefined(array('no-cache', 'nc'), false, true);
verbose("use cache = $useCache");
/**
* quality, q - set level of quality for jpeg images
*/
$quality = get(array('quality', 'q'));
is_null($quality)
or ($quality > 0 and $quality <= 100)
or errorPage('Quality out of range');
verbose("quality = $quality");
/**
* compress, co - what strategy to use when compressing png images
*/
$compress = get(array('compress', 'co'));
is_null($compress)
or ($compress > 0 and $compress <= 9)
or errorPage('Compress out of range');
verbose("compress = $compress");
/**
* save-as, sa - what type of image to save
*/
$saveAs = get(array('save-as', 'sa'));
verbose("save as = $saveAs");
/**
* scale, s - Processing option, scale up or down the image prior actual resize
*/
$scale = get(array('scale', 's'));
is_null($scale)
or ($scale >= 0 and $scale <= 400)
or errorPage('Scale out of range');
verbose("scale = $scale");
/**
* palette, p - Processing option, create a palette version of the image
*/
$palette = getDefined(array('palette', 'p'), true, false);
verbose("palette = $palette");
/**
* sharpen - Processing option, post filter for sharpen effect
*/
$sharpen = getDefined('sharpen', true, null);
verbose("sharpen = $sharpen");
/**
* emboss - Processing option, post filter for emboss effect
*/
$emboss = getDefined('emboss', true, null);
verbose("emboss = $emboss");
/**
* blur - Processing option, post filter for blur effect
*/
$blur = getDefined('blur', true, null);
verbose("blur = $blur");
/**
* rotateBefore - Rotate the image with an angle, before processing
*/
$rotateBefore = get(array('rotateBefore', 'rotate-before', 'rb'));
is_null($rotateBefore)
or ($rotateBefore >= -360 and $rotateBefore <= 360)
or errorPage('RotateBefore out of range');
verbose("rotateBefore = $rotateBefore");
/**
* rotateAfter - Rotate the image with an angle, before processing
*/
$rotateAfter = get(array('rotateAfter', 'rotate-after', 'ra', 'rotate', 'r'));
is_null($rotateAfter)
or ($rotateAfter >= -360 and $rotateAfter <= 360)
or errorPage('RotateBefore out of range');
verbose("rotateAfter = $rotateAfter");
/**
* autoRotate - Auto rotate based on EXIF information
*/
$autoRotate = getDefined(array('autoRotate', 'auto-rotate', 'aro'), true, false);
verbose("autoRotate = $autoRotate");
/**
* filter, f, f0-f9 - Processing option, post filter for various effects using imagefilter()
*/
$filters = array();
$filter = get(array('filter', 'f'));
if ($filter) {
$filters[] = $filter;
}
for ($i = 0; $i < 10; $i++) {
$filter = get(array("filter{$i}", "f{$i}"));
if ($filter) {
$filters[] = $filter;
}
}
verbose("filters = " . print_r($filters, 1));
/**
* json - output the image as a JSON object with details on the image.
*/
$outputFormat = getDefined('json', 'json', null);
verbose("json = $outputFormat");
/**
* dpr - change to get larger image to easier support larger dpr, such as retina.
*/
$dpr = get(array('ppi', 'dpr', 'device-pixel-ratio'), 1);
verbose("dpr = $dpr");
/**
* convolve - image convolution as in http://php.net/manual/en/function.imageconvolution.php
*/
$convolve = get('convolve', null);
$convolutionConstant = getConfig('convolution_constant', array());
// Check if the convolve is matching an existing constant
if ($convolve && isset($convolutionConstant)) {
$img->addConvolveExpressions($convolutionConstant);
verbose("convolve constant = " . print_r($convolutionConstant, 1));
}
verbose("convolve = " . print_r($convolve, 1));
/**
* no-upscale, nu - Do not upscale smaller image to larger dimension.
*/
$upscale = getDefined(array('no-upscale', 'nu'), false, true);
verbose("upscale = $upscale");
/**
* Get details for post processing
*/
$postProcessing = getConfig('postprocessing', array(
'png_filter' => false,
'png_filter_cmd' => '/usr/local/bin/optipng -q',
'png_deflate' => false,
'png_deflate_cmd' => '/usr/local/bin/pngout -q',
'jpeg_optimize' => false,
'jpeg_optimize_cmd' => '/usr/local/bin/jpegtran -copy none -optimize',
));
/**
* alias - Save resulting image to another alias name.
* Password always apply, must be defined.
*/
$alias = get('alias', null);
$aliasPath = getConfig('alias_path', null);
$validAliasname = getConfig('valid_aliasname', '#^[a-z0-9A-Z-_]+$#');
$aliasTarget = null;
if ($alias && $aliasPath && $passwordMatch) {
$aliasTarget = $aliasPath . $alias;
$useCache = false;
is_writable($aliasPath)
or errorPage("Directory for alias is not writable.");
preg_match($validAliasname, $alias)
or errorPage('Filename for alias contains invalid characters. Do not add extension.');
} else if ($alias) {
errorPage('Alias is not enabled in the config file or password not matching.');
}
verbose("alias = $alias");
/**
* Display image if verbose mode
*/
if ($verbose) {
$query = array();
parse_str($_SERVER['QUERY_STRING'], $query);
unset($query['verbose']);
unset($query['v']);
unset($query['nocache']);
unset($query['nc']);
unset($query['json']);
$url1 = '?' . htmlentities(urldecode(http_build_query($query)));
$url2 = '?' . urldecode(http_build_query($query));
echo <<<EOD
<a href=$url1><code>$url1</code></a><br>
<img src='{$url1}' />
<pre id="json"></pre>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
window.getDetails = function (url, id) {
$.getJSON(url, function(data) {
element = document.getElementById(id);
element.innerHTML = "filename: " + data.filename + "\\ncolors: " + data.colors + "\\nsize: " + data.size + "\\nwidth: " + data.width + "\\nheigh: " + data.height + "\\naspect-ratio: " + data.aspectRatio;
});
}
</script>
<script type="text/javascript">window.getDetails("{$url2}&json", "json")</script>
EOD;
}
/**
* Get the cachepath from config.
*/
$cachePath = getConfig('cache_path', __DIR__ . '/../cache/');
/**
* Load, process and output the image
*/
$img->log("Incoming arguments: " . print_r(verbose(), 1))
->setSaveFolder($cachePath)
->useCache($useCache)
->setSource($srcImage, $imagePath)
->setOptions(
array(
// Options for calculate dimensions
'newWidth' => $newWidth,
'newHeight' => $newHeight,
'aspectRatio' => $aspectRatio,
'keepRatio' => $keepRatio,
'cropToFit' => $cropToFit,
'fillToFit' => $fillToFit,
'crop' => $crop,
'area' => $area,
'upscale' => $upscale,
// Pre-processing, before resizing is done
'scale' => $scale,
'rotateBefore' => $rotateBefore,
'autoRotate' => $autoRotate,
// General processing options
'bgColor' => $bgColor,
// Post-processing, after resizing is done
'palette' => $palette,
'filters' => $filters,
'sharpen' => $sharpen,
'emboss' => $emboss,
'blur' => $blur,
'convolve' => $convolve,
'rotateAfter' => $rotateAfter,
// Output format
'outputFormat' => $outputFormat,
'dpr' => $dpr,
)
)
->loadImageDetails()
->initDimensions()
->calculateNewWidthAndHeight()
->setSaveAsExtension($saveAs)
->setJpegQuality($quality)
->setPngCompression($compress)
->useOriginalIfPossible($useOriginal)
->generateFilename($cachePath)
->useCacheIfPossible($useCache)
->load()
->preResize()
->resize()
->postResize()
->setPostProcessingOptions($postProcessing)
->save()
->linkToCacheFile($aliasTarget)
->output();

View File

@@ -0,0 +1,295 @@
<?php
/**
* Configuration for img.php, name the config file the same as your img.php and
* append _config. If you are testing out some in imgtest.php then label that
* config-file imgtest_config.php.
*
*/
return array(
/**
* Set mode as 'strict', 'production' or 'development'.
*
* Default values:
* mode: 'production'
*/
'mode' => 'development',
//'mode' => 'production', // 'development', 'strict'
/**
* Where are the sources for the classfiles.
*
* Default values:
* autoloader: null // used from v0.6.2
* cimage_class: null // used until v0.6.1
*/
'autoloader' => __DIR__ . '/../autoload.php',
//'cimage_class' => __DIR__ . '/../CImage.php',
/**
* Paths, where are the images stored and where is the cache.
* End all paths with a slash.
*
* Default values:
* image_path: __DIR__ . '/img/'
* cache_path: __DIR__ . '/../cache/'
* alias_path: null
*/
'image_path' => __DIR__ . '/img/',
'cache_path' => __DIR__ . '/../cache/',
//'alias_path' => __DIR__ . '/img/alias/',
/**
* Use password to protect from missusage, send &pwd=... or &password=..
* with the request to match the password or set to false to disable.
* Passwords are only used together with the options for remote download
* and aliasing.
*
* Default values.
* password: false // as in do not use password
* password_always: false // do not always require password,
*/
//'password' => false, // "secret-password",
//'password_always' => false, // always require password,
/**
* Allow or disallow downloading of remote images available on
* remote servers. Default is to disallow remote download.
*
* When enabling remote download, the default is to allow download any
* link starting with http or https. This can be changed using
* remote_pattern.
*
* When enabling remote_whitelist a check is made that the hostname of the
* source to download matches the whitelist. By default the check is
* disabled and thereby allowing download from any hosts.
*
* Default values.
* remote_allow: false
* remote_pattern: null // use default values from CImage which is to
* // allow download from any http- and
* // https-source.
* remote_whitelist: null // use default values from CImage which is to
* // allow download from any hosts.
*/
//'remote_allow' => true,
//'remote_pattern' => '#^https?://#',
//'remote_whitelist' => array(
// '\.facebook\.com$',
// '^(?:images|photos-[a-z])\.ak\.instagram\.com$',
// '\.google\.com$'
//),
/**
* A regexp for validating characters in the image or alias filename.
*
* Default value:
* valid_filename: '#^[a-z0-9A-Z-/_\.:]+$#'
* valid_aliasname: '#^[a-z0-9A-Z-_]+$#'
*/
//'valid_filename' => '#^[a-z0-9A-Z-/_\.:]+$#',
//'valid_aliasname' => '#^[a-z0-9A-Z-_]+$#',
/**
* Check that the imagefile is a file below 'image_path' using realpath().
* Security constraint to avoid reaching images outside image_path.
* This means that symbolic links to images outside the image_path will fail.
*
* Default value:
* image_path_constraint: true
*/
//'image_path_constraint' => false,
/**
* Set default timezone.
*
* Default values.
* default_timezone: ini_get('default_timezone') or 'UTC'
*/
//'default_timezone' => 'UTC',
/**
* Max image dimensions, larger dimensions results in 404.
* This is basically a security constraint to avoid using resources on creating
* large (unwanted) images.
*
* Default values.
* max_width: 2000
* max_height: 2000
*/
//'max_width' => 2000,
//'max_height' => 2000,
/**
* Set default background color for all images. Override it using
* option bgColor.
* Colorvalue is 6 digit hex string between 000000-FFFFFF
* or 8 digit hex string if using the alpha channel where
* the alpha value is between 00 (opaqe) and 7F (transparent),
* that is between 00000000-FFFFFF7F.
*
* Default values.
* background_color: As specified by CImage
*/
//'background_color' => "FFFFFF",
//'background_color' => "FFFFFF7F",
/**
* Post processing of images using external tools, set to true or false
* and set command to be executed.
*
* Default values.
*
* png_filter: false
* png_filter_cmd: '/usr/local/bin/optipng -q'
*
* png_deflate: false
* png_deflate_cmd: '/usr/local/bin/pngout -q'
*
* jpeg_optimize: false
* jpeg_optimize_cmd: '/usr/local/bin/jpegtran -copy none -optimize'
*/
/*
'postprocessing' => array(
'png_filter' => false,
'png_filter_cmd' => '/usr/local/bin/optipng -q',
'png_deflate' => false,
'png_deflate_cmd' => '/usr/local/bin/pngout -q',
'jpeg_optimize' => false,
'jpeg_optimize_cmd' => '/usr/local/bin/jpegtran -copy none -optimize',
),
*/
/**
* Create custom convolution expressions, matrix 3x3, divisor and
* offset.
*
* Default values.
* convolution_constant: array()
*/
/*
'convolution_constant' => array(
//'sharpen' => '-1,-1,-1, -1,16,-1, -1,-1,-1, 8, 0',
//'sharpen-alt' => '0,-1,0, -1,5,-1, 0,-1,0, 1, 0',
),
*/
/**
* Prevent leeching of images by controlling who can access them from where.
* Default it to allow hotlinking.
* Password apply when hotlinking is disallowed, use password to allow.
* The whitelist is an array of regexpes for allowed hostnames that can
* hotlink images.
*
* Default values.
* allow_hotlinking: true
* hotlinking_whitelist: array()
*/
/*
'allow_hotlinking' => false,
'hotlinking_whitelist' => array(
'#^localhost$#',
'#^dbwebb\.se$#',
),
*/
/**
* Create custom shortcuts for more advanced expressions.
*
* Default values.
* shortcut: array(
* 'sepia' => "&f=grayscale&f0=brightness,-10&f1=contrast,-20&f2=colorize,120,60,0,0&sharpen",
* )
*/
/*
'shortcut' => array(
'sepia' => "&f=grayscale&f0=brightness,-10&f1=contrast,-20&f2=colorize,120,60,0,0&sharpen",
),*/
/**
* Predefined size constants.
*
* These can be used together with &width or &height to create a constant value
* for a width or height where can be changed in one place.
* Useful when your site changes its layout or if you have a grid to fit images into.
*
* Example:
* &width=w1 // results in width=613
* &width=c2 // results in spanning two columns with a gutter, 30*2+10=70
* &width=c24 // results in spanning whole grid 24*30+((24-1)*10)=950
*
* Default values.
* size_constant: As specified by the function below.
*/
/*
'size_constant' => function () {
// Set sizes to map constant to value, easier to use with width or height
$sizes = array(
'w1' => 613,
'w2' => 630,
);
// Add grid column width, useful for use as predefined size for width (or height).
$gridColumnWidth = 30;
$gridGutterWidth = 10;
$gridColumns = 24;
for ($i = 1; $i <= $gridColumns; $i++) {
$sizes['c' . $i] = ($gridColumnWidth + $gridGutterWidth) * $i - $gridGutterWidth;
}
return $sizes;
},*/
/**
* Predefined aspect ratios.
*
* Default values.
* aspect_ratio_constant: As the function below.
*/
/*'aspect_ratio_constant' => function () {
return array(
'3:1' => 3/1,
'3:2' => 3/2,
'4:3' => 4/3,
'8:5' => 8/5,
'16:10' => 16/10,
'16:9' => 16/9,
'golden' => 1.618,
);
},*/
);

View File

@@ -0,0 +1,36 @@
<?php
/**
* Resize and crop images on the fly, store generated images in a cache.
*
* This version is a all-in-one version of img.php, it is not dependant an any other file
* so you can simply copy it to any place you want it.
*
* @author Mikael Roos mos@dbwebb.se
* @example http://dbwebb.se/opensource/cimage
* @link https://github.com/mosbth/cimage
*
*/
/**
* Change configuration details in the array below or create a separate file
* where you store the configuration details.
*
* The configuration file should be named the same name as this file and then
* add '_config.php'. If this file is named 'img.php' then name the
* config file should be named 'img_config.php'.
*
* The settings below are only a few of the available ones. Check the file in
* webroot/img_config.php for a complete list of configuration options.
*/
$config = array(
//'mode' => 'production', // 'production', 'development', 'strict'
//'image_path' => __DIR__ . '/img/',
//'cache_path' => __DIR__ . '/../cache/',
//'alias_path' => __DIR__ . '/img/alias/',
//'remote_allow' => true,
//'password' => false, // "secret-password",
);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
<?php
// Use error reporting
error_reporting(-1);
ini_set('display_errors', 1);
// The link to img.php
$imgphp = "../img.php?src=";

View File

@@ -0,0 +1,102 @@
<!doctype html>
<head>
<meta charset='utf-8'/>
<title><?=$title?></title>
<style>
body {background-color: #ccc;}
</style>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
window.getDetails = function (url, id) {
$.getJSON(url, function(data) {
element = document.getElementById(id);
element.innerHTML = "filename: " + data.filename + "\ncolors: " + data.colors + "\nsize: " + data.size + "\nwidth: " + data.width + "\nheigh: " + data.height + "\naspect-ratio: " + data.aspectRatio;
});
}
</script>
</head>
<body>
<h1><?=$title?></h1>
<?php if (isset($description)) : ?>
<p><?=$description?></p>
<?php endif; ?>
<h2>Images used in test</h2>
<p>The following images are used for this test.</p>
<?php foreach($images as $image) : ?>
<p>
<code>
<a href="img/<?=$image?>"><?=$image?></a>
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
</code>
<br>
<img src="<?=$imgphp . $image?>"></p>
<p></p>
<pre id="<?=$image?>"></pre>
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$image?>")</script>
<?php endforeach; ?>
<h2>Testcases used for each image</h2>
<p>The following testcases are used for each image.</p>
<?php foreach($testcase as $tc) : ?>
<code><?=$tc?></code><br>
<?php endforeach; ?>
<h2>For each image, apply all testcases</h2>
<?php
$ch1 = 1;
foreach($images as $image) :
?>
<h3><?=$ch1?>. Using source image <?=$image?></h3>
<p>
<code>
<a href="img/<?=$image?>"><?=$image?></a>
<a href="<?=$imgphp . $image . '&json'?>">(json)</a>
<a href="<?=$imgphp . $image . '&verbose'?>">(verbose)</a>
</code>
<br>
<img src="<?=$imgphp . $image?>">
</p>
<pre id="<?=$ch1?>"></pre>
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . '&json'?>", "<?=$ch1?>")</script>
<?php
$ch2 = 1;
foreach($testcase as $tc) :
$tcId = "$ch1.$ch2";
?>
<h4>Testcase <?=$tcId?>: <?=$tc?></h4>
<p>
<code>
<a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a>
<a href="<?=$imgphp . $image . $tc . '&json'?>">(json)</a>
<a href="<?=$imgphp . $image . $tc . '&verbose'?>">(verbose)</a>
</code>
<br>
<img src="<?=$imgphp . $image . $tc?>">
</p>
<pre id="<?=$tcId?>"></pre>
<script type="text/javascript">window.getDetails("<?=$imgphp . $image . $tc . '&json'?>", "<?=$tcId?>")</script>
<?php $ch2++; endforeach; ?>
<?php $ch1++; endforeach; ?>

View File

@@ -0,0 +1,73 @@
<!doctype html>
<head>
<meta charset='utf-8'/>
<title>Testing img resizing using CImage.php</title>
</head>
<body>
<h1>Testing <code>CImage.php</code> through <code>img.php</code></h1>
<h2>Testcases</h2>
<?php
$testcase = array(
array('text'=>'Original image', 'query'=>''),
array('text'=>'Crop out a rectangle of 100x100, start by position 200x200.', 'query'=>'&crop=100,100,200,200'),
array('text'=>'Crop out a full width rectangle with height of 200, start by position 0x100.', 'query'=>'&crop=0,200,0,100'),
array('text'=>'Max width 200.', 'query'=>'&w=200'),
array('text'=>'Max height 200.', 'query'=>'&h=200'),
array('text'=>'Max width 200 and max height 200.', 'query'=>'&w=200&h=200'),
array('text'=>'No-ratio makes image fit in area of width 200 and height 200.', 'query'=>'&w=200&h=200&no-ratio'),
array('text'=>'Crop to fit in width 200 and height 200.', 'query'=>'&w=200&h=200&crop-to-fit'),
array('text'=>'Crop to fit in width 200 and height 100.', 'query'=>'&w=200&h=100&crop-to-fit'),
array('text'=>'Crop to fit in width 100 and height 200.', 'query'=>'&w=100&h=200&crop-to-fit'),
array('text'=>'Quality 70', 'query'=>'&w=200&h=200&quality=70'),
array('text'=>'Quality 40', 'query'=>'&w=200&h=200&quality=40'),
array('text'=>'Quality 10', 'query'=>'&w=200&h=200&quality=10'),
array('text'=>'Filter: Negate', 'query'=>'&w=200&h=200&f=negate'),
array('text'=>'Filter: Grayscale', 'query'=>'&w=200&h=200&f=grayscale'),
array('text'=>'Filter: Brightness 90', 'query'=>'&w=200&h=200&f=brightness,90'),
array('text'=>'Filter: Contrast 50', 'query'=>'&w=200&h=200&f=contrast,50'),
array('text'=>'Filter: Colorize 0,255,0,0', 'query'=>'&w=200&h=200&f=colorize,0,255,0,0'),
array('text'=>'Filter: Edge detect', 'query'=>'&w=200&h=200&f=edgedetect'),
array('text'=>'Filter: Emboss', 'query'=>'&w=200&h=200&f=emboss'),
array('text'=>'Filter: Gaussian blur', 'query'=>'&w=200&h=200&f=gaussian_blur'),
array('text'=>'Filter: Selective blur', 'query'=>'&w=200&h=200&f=selective_blur'),
array('text'=>'Filter: Mean removal', 'query'=>'&w=200&h=200&f=mean_removal'),
array('text'=>'Filter: Smooth 2', 'query'=>'&w=200&h=200&f=smooth,2'),
array('text'=>'Filter: Pixelate 10,10', 'query'=>'&w=200&h=200&f=pixelate,10,10'),
array('text'=>'Multiple filter: Negate, Grayscale and Pixelate 10,10', 'query'=>'&w=200&h=200&&f=negate&f0=grayscale&f1=pixelate,10,10'),
array('text'=>'Crop with width & height and crop-to-fit with quality and filter', 'query'=>'&crop=100,100,100,100&w=200&h=200&crop-to-fit&q=70&f0=grayscale'),
);
?>
<h3>Test case with image <code>wider.jpg</code></h3>
<table>
<caption>Test case with image <code>wider.jpg</code></caption>
<thead><tr><th>Testcase:</th><th>Result:</th></tr></thead>
<tbody>
<?php
foreach($testcase as $key => $val) {
$url = "../img.php?src=wider.jpg{$val['query']}";
echo "<tr><td id=w$key><a href=#w$key>$key</a></br>{$val['text']}</br><code><a href='$url'>".htmlentities($url)."</a></code></td><td><img src='$url' /></td></tr>";
}
?>
</tbody>
</table>
<h3>Test case with image <code>higher.jpg</code></h3>
<table>
<caption>Test case with image <code>higher.jpg</code></caption>
<thead><tr><th>Testcase:</th><th>Result:</th></tr></thead>
<tbody>
<?php
foreach($testcase as $key => $val) {
$url = "../img.php?src=higher.jpg{$val['query']}";
echo "<tr><td id=h$key><a href=#h$key>$key</a></br>{$val['text']}</br><code><a href='$url'>".htmlentities($url)."</a></code></td><td><img src='$url' /></td></tr>";
}
?>
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,39 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing img for issue 29";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'issue29/400x265.jpg',
'issue29/400x268.jpg',
'issue29/400x300.jpg',
'issue29/465x304.jpg',
'issue29/640x273.jpg',
);
// For each image, apply these testcases
$testcase = array(
'&w=300&cf&q=80&nc',
'&w=75&h=75&cf&q=80&nc',
'&w=75&h=75&q=80',
);
// Applu testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 36 - autoRotate";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'issue36/me-0.jpg',
'issue36/me-90.jpg',
'issue36/me-180.jpg',
'issue36/me-270.jpg',
'issue36/flower-0.jpg',
'issue36/flower-90.jpg',
'issue36/flower-180.jpg',
'issue36/flower-270.jpg',
);
// For each image, apply these testcases
$testcase = array(
'&aro&nc',
'&aro&nc&w=200',
'&aro&nc&h=200',
'&aro&nc&w=200&h=200&cf',
);
// Applu testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$angle = 180;
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'kodim08.png',
'kodim04.png',
);
// For each image, apply these testcases
$testcase = array(
"&rb=$angle&nc",
"&rb=$angle&nc&w=200",
"&rb=$angle&nc&h=200",
"&rb=$angle&nc&w=200&h=200&cf",
"&ra=$angle&nc",
"&ra=$angle&nc&w=200",
"&ra=$angle&nc&h=200",
"&ra=$angle&nc&w=200&h=200&cf",
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$angle = 270;
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'kodim08.png',
'kodim04.png',
);
// For each image, apply these testcases
$testcase = array(
"&rb=$angle&nc",
"&rb=$angle&nc&w=200",
"&rb=$angle&nc&h=200",
"&rb=$angle&nc&w=200&h=200&cf",
"&ra=$angle&nc",
"&ra=$angle&nc&w=200",
"&ra=$angle&nc&h=200",
"&ra=$angle&nc&w=200&h=200&cf",
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$angle = 45;
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'kodim08.png',
'kodim04.png',
);
// For each image, apply these testcases
$testcase = array(
"&rb=$angle&nc",
"&rb=$angle&nc&w=200",
"&rb=$angle&nc&h=200",
"&rb=$angle&nc&w=200&h=200&cf",
"&ra=$angle&nc",
"&ra=$angle&nc&w=200",
"&ra=$angle&nc&h=200",
"&ra=$angle&nc&w=200&h=200&cf",
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$angle = 90;
$title = "Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?>";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'kodim08.png',
'kodim04.png',
);
// For each image, apply these testcases
$testcase = array(
"&rb=$angle&nc",
"&rb=$angle&nc&w=200",
"&rb=$angle&nc&h=200",
"&rb=$angle&nc&w=200&h=200&cf",
"&ra=$angle&nc",
"&ra=$angle&nc&w=200",
"&ra=$angle&nc&h=200",
"&ra=$angle&nc&w=200&h=200&cf",
);
// Applu testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,46 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 38 - fill to fit, together with background colors";
// Provide a short description of the testcase.
$description = "The issue was to implement fill-to-fit, but it needs some flexibility in how to choose the background color and it also affects rotation of the image (the background color does). So this testcase is both for fill-to-fit and for background color (thereby including a test using rotate).";
// Use these images in the test
$images = array(
'kodim04.png',
'apple_trans.gif',
'circle_trans.png',
);
// For each image, apply these testcases
$cache = "&nc"; // ""; // "&nc"
$testcase = array(
"$cache&w=300&h=300&fill-to-fit",
"$cache&w=200&h=400&fill-to-fit",
"$cache&w=300&h=300&fill-to-fit=ff0000",
"$cache&w=200&h=400&fill-to-fit=ff0000",
"$cache&w=300&h=300&fill-to-fit=ff00003f",
"$cache&w=200&h=400&fill-to-fit=ff00003f",
"$cache&w=200&h=400&fill-to-fit&bgc=ff0000",
"$cache&w=300&h=300&fill-to-fit&bgc=ff00003f",
"$cache&w=300&h=300&ra=45",
"$cache&w=300&h=300&ra=45&bgc=ff0000",
"$cache&w=300&h=300&ra=45&bgc=ff00003f",
);
// Applu testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,38 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 40 - no ratio";
// Provide a short description of the testcase.
$description = "Showing off how to resize image with and without ratio.";
// Use these images in the test
$images = array(
'issue40/source.jpg',
);
// For each image, apply these testcases
$testcase = array(
'&nc&width=652&height=466',
'&nc&width=652&height=466&no-ratio',
'&nc&width=652&height=466&crop-to-fit',
'&nc&width=652&aspect-ratio=1.4',
'&nc&width=652&aspect-ratio=1.4&no-ratio',
'&nc&width=652&aspect-ratio=1.4&crop-to-fit',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,39 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 49 - flexible convolution";
// Provide a short description of the testcase.
$description = "Creating shortcuts to custom convolutions by using configurable list of constant convolutions.";
// Use these images in the test
$images = array(
'kodim08.png',
);
// For each image, apply these testcases
$testcase = array(
'&nc&width=400&convolve=lighten',
'&nc&width=400&convolve=darken',
'&nc&width=400&convolve=sharpen',
'&nc&width=400&convolve=emboss',
'&nc&width=400&convolve=blur',
'&nc&width=400&convolve=blur:blur',
'&nc&width=400&convolve=blur:blur:blur:blur',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,42 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 52 - Fill to fit fails with aspect ratio";
// Provide a short description of the testcase.
$description = "Verify that Fill To Fit resize strategy works with all variants of sizes.";
// Use these images in the test
$images = array(
'car.png',
);
// For each image, apply these testcases
$nc = '&nc';
$testcase = array(
$nc . '&w=300&h=300&crop-to-fit',
$nc . '&w=300&ar=1&crop-to-fit',
$nc . '&w=300&ar=3&crop-to-fit',
$nc . '&h=300&ar=1&crop-to-fit',
$nc . '&h=300&ar=3&crop-to-fit',
$nc . '&w=50%&ar=1&crop-to-fit',
$nc . '&w=50%&ar=3&crop-to-fit',
$nc . '&h=50%&ar=1&crop-to-fit',
$nc . '&h=50%&ar=3&crop-to-fit',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,42 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 52 - Fill to fit fails with aspect ratio";
// Provide a short description of the testcase.
$description = "Verify that Fill To Fit resize strategy works with all variants of sizes.";
// Use these images in the test
$images = array(
'car.png',
);
// For each image, apply these testcases
$nc = '&nc';
$testcase = array(
$nc . '&w=300&h=300&stretch',
$nc . '&w=300&ar=1&stretch',
$nc . '&w=300&ar=3&stretch',
$nc . '&h=300&ar=1&stretch',
$nc . '&h=300&ar=3&stretch',
$nc . '&w=50%&ar=1&stretch',
$nc . '&w=50%&ar=3&stretch',
$nc . '&h=50%&ar=1&stretch',
$nc . '&h=50%&ar=3&stretch',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,42 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 52 - Fill to fit fails with aspect ratio";
// Provide a short description of the testcase.
$description = "Verify that Fill To Fit resize strategy works with all variants of sizes.";
// Use these images in the test
$images = array(
'car.png',
);
// For each image, apply these testcases
$nc = null; //&nc';
$testcase = array(
$nc . '&w=300&h=300&fill-to-fit',
$nc . '&w=300&ar=1&fill-to-fit',
$nc . '&w=300&ar=2&fill-to-fit',
$nc . '&h=300&ar=1&fill-to-fit',
$nc . '&h=300&ar=2&fill-to-fit',
$nc . '&w=50%&ar=1&fill-to-fit',
$nc . '&w=50%&ar=2&fill-to-fit',
$nc . '&h=50%&ar=1&fill-to-fit',
$nc . '&h=50%&ar=2&fill-to-fit',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,37 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 58 - JSON reporting filesize";
// Provide a short description of the testcase.
$description = "Verify that JSON returns filesize of actual image.";
// Use these images in the test
$images = array(
'kodim08.png',
);
// For each image, apply these testcases
$testcase = array(
'&w=300',
'&w=300&h=300',
'&w=300&h=300&stretch',
'&w=300&h=300&crop-to-fit',
'&w=300&h=300&fill-to-fit',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,34 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing issue 60 - skip original";
// Provide a short description of the testcase.
$description = "Always use the original if suitable, use skip-original to force using the cached version.";
// Use these images in the test
$images = array(
'car.png',
);
// For each image, apply these testcases
$testcase = array(
'',
'&so',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,42 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing option crop";
// Provide a short description of the testcase.
$description = "Cropping parts of image";
// Use these images in the test
$images = array(
'kodim04.png',
);
// For each image, apply these testcases
$nc = "&nc"; //null; //&nc';
$testcase = array(
$nc . '&w=300',
$nc . '&w=300&crop=0,0,0,0',
$nc . '&crop=300,200,0,0',
$nc . '&crop=300,200,left,top',
$nc . '&crop=300,200,right,top',
$nc . '&crop=300,200,right,bottom',
$nc . '&crop=300,200,left,bottom',
$nc . '&crop=300,200,center,center',
$nc . '&crop=200,220,190,300',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,59 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing option no-upscale";
// Provide a short description of the testcase.
$description = "Do not upscale image when original image (slice) is smaller than target image.";
// Use these images in the test
$images = array(
'car.png',
);
// For each image, apply these testcases
$nc = null; //"&nc"; //null; //&nc';
$testcase = array(
$nc . '&w=600',
$nc . '&w=600&no-upscale',
$nc . '&h=400',
$nc . '&h=400&no-upscale',
$nc . '&w=600&h=400',
$nc . '&w=600&h=400&no-upscale',
$nc . '&w=700&h=400&stretch',
$nc . '&w=700&h=400&no-upscale&stretch',
$nc . '&w=700&h=200&stretch',
$nc . '&w=700&h=200&no-upscale&stretch',
$nc . '&w=300&h=400&stretch',
$nc . '&w=300&h=400&no-upscale&stretch',
$nc . '&w=600&h=400&crop-to-fit',
$nc . '&w=600&h=400&no-upscale&crop-to-fit',
$nc . '&w=600&h=200&crop-to-fit',
$nc . '&w=600&h=200&no-upscale&crop-to-fit',
$nc . '&w=300&h=400&crop-to-fit',
$nc . '&w=300&h=400&no-upscale&crop-to-fit',
$nc . '&w=600&h=400&fill-to-fit',
$nc . '&w=600&h=400&no-upscale&fill-to-fit',
/*
$nc . '&w=600&ar=1.6',
$nc . '&w=600&ar=1.6&no-upscale',
$nc . '&h=400&ar=1.6',
$nc . '&h=400&ar=1.6&no-upscale',
*/
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,43 @@
<?php
// Include config for all testcases
include __DIR__ . "/config.php";
// The title of the test case
$title = "Testing option save-as - save image to another format";
// Provide a short description of the testcase.
$description = "";
// Use these images in the test
$images = array(
'car.png',
'car.gif',
'car.jpg',
'ball24.png',
'wider.jpg',
);
// For each image, apply these testcases
$nc = "&nc"; //null; //&nc';
$testcase = array(
$nc . '&w=300',
$nc . '&w=300&sa=jpg',
$nc . '&w=300&sa=png',
$nc . '&w=300&sa=gif',
$nc . '&w=300&palette',
$nc . '&w=300&sa=png&palette',
);
// Apply testcases and present results
include __DIR__ . "/template.php";

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-757827638"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-757827638" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>check_system.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/check_system.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1907041064"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1907041064" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/compare</small>compare-test.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/compare/compare-test.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1603660564"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1603660564" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/compare</small>compare.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/compare/compare.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,518 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-543265601"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-543265601" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>img.php</h1>
<p><em>Resize and crop images on the fly, store generated images in a cache.</em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
<dt>See also</dt>
<dd><a href="https://github.com/mosbth/cimage"><div class="namespace-wrapper">https://github.com/mosbth/cimage</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Mikael Roos mos@dbwebb.se</p>
</td>
</tr>
<tr>
<th>
example
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<section class="span8 content file">
<h2>Functions</h2>
</section>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_errorPage" name="method_errorPage" class="anchor"></a>
<article class="method">
<h3 class=" ">errorPage()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">errorPage(string <span class="argument">$msg</span>) : void</pre>
<p><em>Display error message.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to display.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/img.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_get" name="method_get" class="anchor"></a>
<article class="method">
<h3 class=" ">get()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">get(mixed <span class="argument">$key</span>, mixed <span class="argument">$default = null</span>) : mixed</pre>
<p><em>Get input from query string or return default value if not set.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value from $_GET or default value.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/img.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDefined" name="method_getDefined" class="anchor"></a>
<article class="method">
<h3 class=" ">getDefined()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDefined(mixed <span class="argument">$key</span>, mixed <span class="argument">$defined</span>, mixed <span class="argument">$undefined</span>) : mixed</pre>
<p><em>Get input from query string and set to $defined if defined or else $undefined.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$defined </td>
<td><p>value to return when $key is set in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$undefined </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $defined or $undefined.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/img.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getConfig" name="method_getConfig" class="anchor"></a>
<article class="method">
<h3 class=" ">getConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getConfig(string <span class="argument">$key</span>, mixed <span class="argument">$default</span>) : mixed</pre>
<p><em>Get value from config array or default if key is not set in config array.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$key </td>
<td><p>the key in the config array.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to be default if $key is not set in config.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $config[$key] or $default.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/img.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verbose" name="method_verbose" class="anchor"></a>
<article class="method">
<h3 class=" ">verbose()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verbose(string <span class="argument">$msg = null</span>) : void</pre>
<p><em>Log when verbose mode, when used without argument it returns the result.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to log.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/img.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/img.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,252 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">40</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">2</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-112631378"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-112631378" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CAsciiArt.html">CAsciiArt</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>img_config.php</h1>
<p><em>Configuration for img.php, name the config file the same as your img.php and
append _config. If you are testing out some in imgtest.php then label that
config-file imgtest_config.php.</em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/img_config.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on December 2nd, 2015 at 11:04.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,278 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-7868195"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-7868195" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>img_header.php</h1>
<p><em>Resize and crop images on the fly, store generated images in a cache.</em></p>
<p>This version is a all-in-one version of img.php, it is not dependant an any other file
so you can simply copy it to any place you want it.</p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
<dt>See also</dt>
<dd><a href="https://github.com/mosbth/cimage"><div class="namespace-wrapper">https://github.com/mosbth/cimage</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Mikael Roos mos@dbwebb.se</p>
</td>
</tr>
<tr>
<th>
example
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/img_header.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,544 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-91016725"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-91016725" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>imgd.php</h1>
<p><em>Resize and crop images on the fly, store generated images in a cache.</em></p>
<p>This version is a all-in-one version of img.php, it is not dependant an any other file
so you can simply copy it to any place you want it.</p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CHttpGet.html">CHttpGet</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CRemoteImage.html">CRemoteImage</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CImage.html">CImage</a></td>
<td><em>Resize and crop images on the fly, store generated images in a cache.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
<dt>See also</dt>
<dd><a href="https://github.com/mosbth/cimage"><div class="namespace-wrapper">https://github.com/mosbth/cimage</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Mikael Roos mos@dbwebb.se</p>
</td>
</tr>
<tr>
<th>
example
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<section class="span8 content file">
<h2>Functions</h2>
</section>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_errorPage" name="method_errorPage" class="anchor"></a>
<article class="method">
<h3 class=" ">errorPage()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">errorPage(string <span class="argument">$msg</span>) : void</pre>
<p><em>Default configuration options, can be overridden in own config-file.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to display.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgd.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_get" name="method_get" class="anchor"></a>
<article class="method">
<h3 class=" ">get()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">get(mixed <span class="argument">$key</span>, mixed <span class="argument">$default = null</span>) : mixed</pre>
<p><em>Get input from query string or return default value if not set.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value from $_GET or default value.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgd.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDefined" name="method_getDefined" class="anchor"></a>
<article class="method">
<h3 class=" ">getDefined()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDefined(mixed <span class="argument">$key</span>, mixed <span class="argument">$defined</span>, mixed <span class="argument">$undefined</span>) : mixed</pre>
<p><em>Get input from query string and set to $defined if defined or else $undefined.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$defined </td>
<td><p>value to return when $key is set in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$undefined </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $defined or $undefined.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgd.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getConfig" name="method_getConfig" class="anchor"></a>
<article class="method">
<h3 class=" ">getConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getConfig(string <span class="argument">$key</span>, mixed <span class="argument">$default</span>) : mixed</pre>
<p><em>Get value from config array or default if key is not set in config array.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$key </td>
<td><p>the key in the config array.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to be default if $key is not set in config.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $config[$key] or $default.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgd.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verbose" name="method_verbose" class="anchor"></a>
<article class="method">
<h3 class=" ">verbose()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verbose(string <span class="argument">$msg = null</span>) : void</pre>
<p><em>Log when verbose mode, when used without argument it returns the result.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to log.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgd.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/imgd.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,544 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-466042370"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-466042370" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>imgp.php</h1>
<p><em>Resize and crop images on the fly, store generated images in a cache.</em></p>
<p>This version is a all-in-one version of img.php, it is not dependant an any other file
so you can simply copy it to any place you want it.</p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CHttpGet.html">CHttpGet</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CRemoteImage.html">CRemoteImage</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CImage.html">CImage</a></td>
<td><em>Resize and crop images on the fly, store generated images in a cache.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
<dt>See also</dt>
<dd><a href="https://github.com/mosbth/cimage"><div class="namespace-wrapper">https://github.com/mosbth/cimage</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Mikael Roos mos@dbwebb.se</p>
</td>
</tr>
<tr>
<th>
example
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<section class="span8 content file">
<h2>Functions</h2>
</section>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_errorPage" name="method_errorPage" class="anchor"></a>
<article class="method">
<h3 class=" ">errorPage()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">errorPage(string <span class="argument">$msg</span>) : void</pre>
<p><em>Default configuration options, can be overridden in own config-file.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to display.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgp.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_get" name="method_get" class="anchor"></a>
<article class="method">
<h3 class=" ">get()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">get(mixed <span class="argument">$key</span>, mixed <span class="argument">$default = null</span>) : mixed</pre>
<p><em>Get input from query string or return default value if not set.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value from $_GET or default value.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgp.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDefined" name="method_getDefined" class="anchor"></a>
<article class="method">
<h3 class=" ">getDefined()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDefined(mixed <span class="argument">$key</span>, mixed <span class="argument">$defined</span>, mixed <span class="argument">$undefined</span>) : mixed</pre>
<p><em>Get input from query string and set to $defined if defined or else $undefined.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$defined </td>
<td><p>value to return when $key is set in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$undefined </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $defined or $undefined.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgp.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getConfig" name="method_getConfig" class="anchor"></a>
<article class="method">
<h3 class=" ">getConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getConfig(string <span class="argument">$key</span>, mixed <span class="argument">$default</span>) : mixed</pre>
<p><em>Get value from config array or default if key is not set in config array.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$key </td>
<td><p>the key in the config array.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to be default if $key is not set in config.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $config[$key] or $default.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgp.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verbose" name="method_verbose" class="anchor"></a>
<article class="method">
<h3 class=" ">verbose()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verbose(string <span class="argument">$msg = null</span>) : void</pre>
<p><em>Log when verbose mode, when used without argument it returns the result.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to log.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgp.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/imgp.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,544 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-331213822"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-331213822" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot</small>imgs.php</h1>
<p><em>Resize and crop images on the fly, store generated images in a cache.</em></p>
<p>This version is a all-in-one version of img.php, it is not dependant an any other file
so you can simply copy it to any place you want it.</p>
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/CHttpGet.html">CHttpGet</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CRemoteImage.html">CRemoteImage</a></td>
<td><em>Get a image from a remote server using HTTP GET and If-Modified-Since.</em></td>
</tr>
<tr>
<td><a href="../classes/CImage.html">CImage</a></td>
<td><em>Resize and crop images on the fly, store generated images in a cache.</em></td>
</tr>
</table>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
<dt>See also</dt>
<dd><a href="https://github.com/mosbth/cimage"><div class="namespace-wrapper">https://github.com/mosbth/cimage</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Mikael Roos mos@dbwebb.se</p>
</td>
</tr>
<tr>
<th>
example
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<section class="span8 content file">
<h2>Functions</h2>
</section>
<aside class="span4 detailsbar"></aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_errorPage" name="method_errorPage" class="anchor"></a>
<article class="method">
<h3 class=" ">errorPage()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">errorPage(string <span class="argument">$msg</span>) : void</pre>
<p><em>Default configuration options, can be overridden in own config-file.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to display.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgs.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_get" name="method_get" class="anchor"></a>
<article class="method">
<h3 class=" ">get()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">get(mixed <span class="argument">$key</span>, mixed <span class="argument">$default = null</span>) : mixed</pre>
<p><em>Get input from query string or return default value if not set.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value from $_GET or default value.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgs.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getDefined" name="method_getDefined" class="anchor"></a>
<article class="method">
<h3 class=" ">getDefined()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getDefined(mixed <span class="argument">$key</span>, mixed <span class="argument">$defined</span>, mixed <span class="argument">$undefined</span>) : mixed</pre>
<p><em>Get input from query string and set to $defined if defined or else $undefined.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>mixed</td>
<td>$key </td>
<td><p>as string or array of string values to look for in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$defined </td>
<td><p>value to return when $key is set in $_GET.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$undefined </td>
<td><p>value to return when $key is not set in $_GET.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $defined or $undefined.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgs.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getConfig" name="method_getConfig" class="anchor"></a>
<article class="method">
<h3 class=" ">getConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getConfig(string <span class="argument">$key</span>, mixed <span class="argument">$default</span>) : mixed</pre>
<p><em>Get value from config array or default if key is not set in config array.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$key </td>
<td><p>the key in the config array.</p></td>
</tr>
<tr>
<td>mixed</td>
<td>$default </td>
<td><p>value to be default if $key is not set in config.</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>value as $config[$key] or $default.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgs.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verbose" name="method_verbose" class="anchor"></a>
<article class="method">
<h3 class=" ">verbose()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verbose(string <span class="argument">$msg = null</span>) : void</pre>
<p><em>Log when verbose mode, when used without argument it returns the result.</em></p>
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$msg </td>
<td><p>to log.</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">webroot/imgs.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
package
</th>
<td>
<p>Default</p>
</td>
</tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/imgs.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-250109129"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-250109129" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/test</small>config.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/test/config.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1196601751"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1196601751" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/test</small>template.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/test/template.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-875354507"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-875354507" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/test</small>test.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/test/test.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>CImage API Documentaion</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
<link href="../css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="../js/html5.js"></script>
<![endif]-->
<script src="../js/jquery-1.11.0.min.js"></script>
<script src="../js/ui/1.10.4/jquery-ui.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
var code = document.createElement('code');
code.className = 'language-' + language;
pre.textContent = '';
code.textContent = 'Loading…';
pre.appendChild(code);
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
xhr.send(null);
});
}
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">CImage API Documentaion</a>
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">126</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">683</span>
</a>
</li>
<li>
<a href="../reports/deprecated.html">
<i class="icon-list-alt"></i>&#160;Deprecated <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2116914885"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-2116914885" class="accordion-body collapse in">
<div class="accordion-inner">
<ul>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CHttpGet.html">CHttpGet</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage.html">CImage</a></li>
<li class="class"><a href="../classes/CImage_RemoteDownloadTest.html">CImage_RemoteDownloadTest</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CRemoteImage.html">CRemoteImage</a></li>
<li class="class"><a href="../classes/CWhitelist.html">CWhitelist</a></li>
<li class="class"><a href="../classes/CWhitelistTest.html">CWhitelistTest</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small>webroot/test</small>test_issue29.php</h1>
<p><em></em></p>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Default</div></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
</aside>
</div>
</div>
</section>
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/webroot/test/test_issue29.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 4th, 2015 at 10:43.
</section>
</section>
</section>
</footer>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More