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 diff --git a/README.md b/README.md index 742790f..8193cf2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -[![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 ------------------------------------- @@ -75,7 +76,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. diff --git a/REVISION.md b/REVISION.md index 69f6eae..02e761f 100644 --- a/REVISION.md +++ b/REVISION.md @@ -5,11 +5,14 @@ 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-24) +v0.7.7* (2015-10-25) ------------------------------------- * Added conversion to sRGB using option `?srgb`. #120. * Change path in `webroot/htaccess` to make it work in current environment. +* 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. v0.7.7 (2015-10-21) 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 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 @@