From 1f012ac19ecbff809db86b6adb6285901cb71f0f Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Thu, 22 Oct 2015 16:52:08 +0200 Subject: [PATCH 1/8] production should be default mode --- webroot/img_config.php | 1 - 1 file changed, 1 deletion(-) diff --git a/webroot/img_config.php b/webroot/img_config.php index e84db44..cc7ab2c 100644 --- a/webroot/img_config.php +++ b/webroot/img_config.php @@ -13,7 +13,6 @@ return array( * Default values: * mode: 'production' */ - 'mode' => 'development', // 'development', 'strict' //'mode' => 'production', // 'development', 'strict' From b93d1242db02369761d2cbaaa0c38828c9a31115 Mon Sep 17 00:00:00 2001 From: Sony AK Date: Wed, 18 Nov 2015 11:34:22 +0700 Subject: [PATCH 2/8] fix the proper download URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 742790f..ff5ce2c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ There are some all-included bundles of `img.php` that can be downloaded and used Dowload the version of your choice like this. ```bash -wget https://github.com/mosbth/cimage/tree/v0.7.7/webroot/imgp.php +wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.7/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. From 8aea13ba338a8b73c6f50568f7d97cb165e3ca73 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Mon, 23 Nov 2015 12:57:52 +0000 Subject: [PATCH 3/8] Add Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ff5ce2c..ce64a7a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ 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) + About ------------------------------------- From 39cee7647e82b92cf26188251f016e3daefb0ceb Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 25 Nov 2015 10:04:24 +0100 Subject: [PATCH 4/8] Added Gitter badge to README, #126. --- README.md | 5 ++--- REVISION.md | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce64a7a..8193cf2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -[![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) - 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 ------------------------------------- diff --git a/REVISION.md b/REVISION.md index 3473578..300976a 100644 --- a/REVISION.md +++ b/REVISION.md @@ -5,6 +5,13 @@ Revision history [![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.7* (2015-10-25) +------------------------------------- + +* Added Gitter badge to README, #126. +* Fix proper download url in README, #125. + + v0.7.7 (2015-10-21) ------------------------------------- From 9c81286efaeae6490bc928a921ee872b7bb3a3e1 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 2 Dec 2015 11:02:03 +0100 Subject: [PATCH 5/8] adding hook for gitter --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 84b5354..9f15485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,16 @@ php: - 5.6 - hhvm - nightly + - "7.0" script: - phpunit notifications: irc: "irc.freenode.org#dbwebb" + webhooks: + urls: + - https://webhooks.gitter.im/e/cce29c69604daa8a60ab + 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 From 8e1318c31ea0f3c72372c245e0b976ab2d85039a Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 2 Dec 2015 11:02:42 +0100 Subject: [PATCH 6/8] enable code coverage whitelist --- phpunit.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index e406494..f24af52 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,4 +13,10 @@ + + + *.php + + + From 91ae49b3f37e05ea1fbd333fd2ede29dbb20d8d4 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 2 Dec 2015 11:04:42 +0100 Subject: [PATCH 7/8] More examples on dealing with cache through bash bin/cache.bash, #129. --- REVISION.md | 1 + bin/cache.bash | 43 +++++++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/REVISION.md b/REVISION.md index 300976a..c64b7ea 100644 --- a/REVISION.md +++ b/REVISION.md @@ -8,6 +8,7 @@ Revision history v0.7.7* (2015-10-25) ------------------------------------- +* More examples on dealing with cache through bash `bin/cache.bash`, #129. * Added Gitter badge to README, #126. * Fix proper download url in README, #125. diff --git a/bin/cache.bash b/bin/cache.bash index 22c69e7..c5cb782 100755 --- a/bin/cache.bash +++ b/bin/cache.bash @@ -1,22 +1,17 @@ #!/bin/bash - # -# Specify the utilities used +# ls -ult list and sorts fils by its access time # -ECHO="printf" - - - # # Main, start by checking basic usage # if [ $# -lt 1 ] then - $ECHO "Usage: $0 [cache-dir]\n" + echo "Usage: $0 [cache-dir]" exit 1 elif [ ! -d "$1" ]; then - $ECHO "Usage: $0 [cache-dir]\n" - $ECHO "$1 is not a directory.\n" + echo "Usage: $0 [cache-dir]" + echo "$1 is not a directory." exit 1 fi @@ -25,12 +20,24 @@ fi # # Print out details on cache-directory # -$ECHO "Total size: $( du -sh $1 | cut -f1 )" -$ECHO "\nNumber of files: $( find $1 | wc -l )" -$ECHO "\n\nTop-5 largest files:\n" -$ECHO "$( du -s $1/* | sort -nr | head -5 )" -$ECHO "\n\nLast-5 created files:\n" -$ECHO "$( find $1/* -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -r | head -5 )" -$ECHO "\n\nLast-5 accessed files:\n" -$ECHO "$( find $1/* -printf '%AY-%Am-%Ad %AH:%AM %f\n' | sort -r | head -5 )" -$ECHO "\n" +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 From b871dd7f1c2449503dfefed385a8738b158dcf3d Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Wed, 2 Dec 2015 11:05:41 +0100 Subject: [PATCH 8/8] update docs/api with phpdoc --- docs/api/classes/CAsciiArt.html | 731 +++++++++++ docs/api/classes/CHttpGet.html | 74 +- docs/api/classes/CImage.html | 1038 +++++++++++++-- docs/api/classes/CRemoteImage.html | 110 +- docs/api/classes/CWhitelist.html | 17 +- docs/api/files/CAsciiArt.html | 257 ++++ docs/api/files/CAsciiArt.php.txt | 213 +++ docs/api/files/CHttpGet.html | 13 +- docs/api/files/CHttpGet.php.txt | 54 +- docs/api/files/CImage.html | 13 +- docs/api/files/CImage.php.txt | 565 ++++++-- docs/api/files/CRemoteImage.html | 13 +- docs/api/files/CRemoteImage.php.txt | 101 +- docs/api/files/CWhitelist.html | 13 +- docs/api/files/CWhitelist.php.txt | 14 +- docs/api/files/autoload.html | 13 +- docs/api/files/autoload.php.txt | 2 +- docs/api/files/webroot.img.html | 15 +- docs/api/files/webroot.img_config.html | 13 +- docs/api/files/webroot/img.php.txt | 1167 +++++++++++++++++ docs/api/files/webroot/img_config.php.txt | 386 ++++++ docs/api/graphs/class.html | 6 +- docs/api/graphs/classes.svg | 29 +- docs/api/index.html | 19 +- docs/api/namespaces/default.html | 19 +- ...-file_5de178c5dafcaff40d31e6fe8bec9eea.dat | Bin 44103 -> 48283 bytes ...-file_58c9e20d7971fb3461feadcf8052d7c6.dat | Bin 39662 -> 34882 bytes ...-file_05104b5f33216f058e4b600e59ccee4e.dat | Bin 253004 -> 297123 bytes ...-file_ace2bb5eac6f81a3a5d8d5eeb2b59685.dat | Bin 0 -> 33990 bytes ...-file_73f6e60ef59c0c30ffc560b4da7243ca.dat | Bin 13903 -> 13188 bytes ...-file_2c624667a65767f32365565ca6d89fea.dat | Bin 30835 -> 36436 bytes ...-file_ec58a87628ba00fb2321bc6cdb7d54b4.dat | Bin 10977 -> 11016 bytes ...-file_83ad6bd4885732fd14b9d8709d592efd.dat | Bin 3176 -> 2758 bytes docs/api/reports/deprecated.html | 6 +- docs/api/reports/errors.html | 161 ++- docs/api/reports/markers.html | 920 +------------ 36 files changed, 4492 insertions(+), 1490 deletions(-) create mode 100644 docs/api/classes/CAsciiArt.html create mode 100644 docs/api/files/CAsciiArt.html create mode 100644 docs/api/files/CAsciiArt.php.txt create mode 100644 docs/api/files/webroot/img.php.txt create mode 100644 docs/api/files/webroot/img_config.php.txt create mode 100644 docs/api/phpdoc-cache-aa/phpdoc-cache-file_ace2bb5eac6f81a3a5d8d5eeb2b59685.dat diff --git a/docs/api/classes/CAsciiArt.html b/docs/api/classes/CAsciiArt.html new file mode 100644 index 0000000..17073e8 --- /dev/null +++ b/docs/api/classes/CAsciiArt.html @@ -0,0 +1,731 @@ + + + + + + CImage API Documentaion + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\CAsciiArt

+

Create an ASCII version of an image.

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ addCharacterSet()
+ setOptions()
+ createFromFile()
+ luminanceAreaAverage()
+ getLuminance()
+ luminance2character()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ $characterSet
+ $characters
+ $charCount
+ $scale
+ $luminanceStrategy
+
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$characterSet

+
$characterSet : 
+

Character set to use.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$characters

+
$characters : 
+

Current character set.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$charCount

+
$charCount : 
+

Length of current character set.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$scale

+
$scale : 
+

Scale of the area to swap to a character.

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$luminanceStrategy

+
$luminanceStrategy : 
+

Strategy to calculate luminance.

+ + +

Type

+ +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct() 
+

Constructor which sets default options.

+ + + + + +
+
+ +
+ +
+
+ +
+

addCharacterSet()

+ +
addCharacterSet(string  $key, string  $value) : $this
+

Add a custom character set.

+ + +

Parameters

+ + + + + + + + + + + +
string$key

for the character set.

string$value

for the character set.

+ + +

Returns

+ $this + +
+
+ +
+ +
+
+ +
+

setOptions()

+ +
setOptions(array  $options = array()) : $this
+

Set options for processing, defaults are available.

+ + +

Parameters

+ + + + + + +
array$options

to use as default settings.

+ + +

Returns

+ $this + +
+
+ +
+ +
+
+ +
+

createFromFile()

+ +
createFromFile(string  $filename) : string
+

Create an Ascii image from an image file.

+ + +

Parameters

+ + + + + + +
string$filename

of the image to use.

+ + +

Returns

+ string + —

$ascii with the ASCII image.

+ +
+
+ +
+ +
+
+ +
+

luminanceAreaAverage()

+ +
luminanceAreaAverage(string  $img, integer  $x1, integer  $y1, integer  $x2, integer  $y2) : integer
+

Get the luminance from a region of an image using average color value.

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$img

the image.

integer$x1

the area to get pixels from.

integer$y1

the area to get pixels from.

integer$x2

the area to get pixels from.

integer$y2

the area to get pixels from.

+ + +

Returns

+ integer + —

$luminance with a value between 0 and 100.

+ +
+
+ +
+ +
+
+ +
+

getLuminance()

+ +
getLuminance(integer  $red, integer  $green, integer  $blue) : float
+

Calculate luminance value with different strategies.

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
integer$red

The color red.

integer$green

The color green.

integer$blue

The color blue.

+ + +

Returns

+ float + —

$luminance with a value between 0 and 1.

+ +
+
+ +
+ +
+
+ +
+

luminance2character()

+ +
luminance2character(  $luminance) : string
+

Translate the luminance value to a character.

+ + +

Parameters

+ + + + + + +
$luminance
+ + +

Returns

+ string + —

with the ascii character.

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/api/classes/CHttpGet.html b/docs/api/classes/CHttpGet.html index a456b80..ea8f9c1 100644 --- a/docs/api/classes/CHttpGet.html +++ b/docs/api/classes/CHttpGet.html @@ -106,12 +106,12 @@