recognizing img basing on extension
This commit is contained in:
parent
97901391f4
commit
437d50c6f6
|
@ -32,10 +32,8 @@ class OC_Gallery_Hooks_Handlers {
|
||||||
private static $APP_TAG = "Gallery";
|
private static $APP_TAG = "Gallery";
|
||||||
|
|
||||||
private static function isPhoto($filename) {
|
private static function isPhoto($filename) {
|
||||||
OC_Log::write(self::$APP_TAG, "Checking file ".$filename." with mimetype ".OC_Filesystem::getMimeType($filename), OC_Log::DEBUG);
|
$ext = strtolower(substr($filename, strrpos($filename, '.')+1));
|
||||||
if (substr(OC_Filesystem::getMimeType($filename), 0, 6) == "image/")
|
return $ext=='png' || $ext=='jpeg' || $ext=='jpg' || $ext=='gif';
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function directoryContainsPhotos($dirpath) {
|
private static function directoryContainsPhotos($dirpath) {
|
||||||
|
|
|
@ -88,9 +88,8 @@ class OC_Gallery_Scanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isPhoto($filename) {
|
public static function isPhoto($filename) {
|
||||||
if (substr(OC_Filesystem::getMimeType($filename), 0, 6) == "image/")
|
$ext = strtolower(substr($filename, strrpos($filename, '.')+1));
|
||||||
return 1;
|
return $ext=='png' || $ext=='jpeg' || $ext=='jpg' || $ext=='gif';
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function find_paths($path) {
|
public static function find_paths($path) {
|
||||||
|
|
Loading…
Reference in New Issue