mirror of
https://github.com/ivuorinen/palette.git
synced 2026-01-26 03:24:08 +00:00
Code style changes and added travis build badge to README
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Palette
|
||||
Palette [](https://travis-ci.org/ivuorinen/palette)
|
||||
=======
|
||||
|
||||
Palette is a PHP class that takes your images and returns used colors, sorts them by usage and saves the results.
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Palette
|
||||
* Parses image and returns most used colors
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* MIT License
|
||||
* ===========
|
||||
*
|
||||
@@ -163,9 +161,9 @@ class Palette
|
||||
|
||||
if (! empty($this->colorsArray) and is_array($this->colorsArray)) {
|
||||
return $this->colorsArray;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,9 +253,8 @@ class Palette
|
||||
file_put_contents($this->destination, $colorsData);
|
||||
if (is_readable($this->destination)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,11 +320,10 @@ class Palette
|
||||
|
||||
// Test if we can write to it
|
||||
try {
|
||||
if (! is_writable($destination_dir)) {
|
||||
chmod($destination_dir, 0755);
|
||||
} else {
|
||||
if (is_writable($destination_dir)) {
|
||||
return true;
|
||||
}
|
||||
chmod($destination_dir, 0755);
|
||||
|
||||
if (! is_writable($destination_dir)) {
|
||||
throw new \Exception("Destination directory not writable: {$destination_dir}");
|
||||
|
||||
Reference in New Issue
Block a user