Merge branch 'master' of github.com:shish/shimmie2

This commit is contained in:
Shish
2012-01-16 20:59:00 +00:00
4 changed files with 19 additions and 5 deletions

View File

@@ -48,6 +48,14 @@ class PixelFileHandler extends DataHandlerExtension {
}
protected function create_thumb($hash) {
$outname = warehouse_path("thumbs", $hash);
if(file_exists($outname)) {
return true;
}
return $this->create_thumb_force($hash);
}
protected function create_thumb_force($hash) {
$inname = warehouse_path("images", $hash);
$outname = warehouse_path("thumbs", $hash);
global $config;

View File

@@ -89,17 +89,18 @@ class ImageReplaceException extends SCoreException {
* Request a thumbnail be made for an image object.
*/
class ThumbnailGenerationEvent extends Event {
var $hash, $type;
var $hash, $type, $force;
/**
* Request a thumbnail be made for an image object
*
* @param $hash The unique hash of the image
* @param $type The type of the image
*/
public function ThumbnailGenerationEvent($hash, $type) {
public function ThumbnailGenerationEvent($hash, $type, $force=false) {
$this->hash = $hash;
$this->type = $type;
$this->force = $force;
}
}