make oc_image work when php_exif isn't enabled
This commit is contained in:
parent
1c311c36bf
commit
6866165a37
|
@ -21,8 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** From user comments at http://dk2.php.net/manual/en/function.exif-imagetype.php
|
//From user comments at http://dk2.php.net/manual/en/function.exif-imagetype.php
|
||||||
* Don't know if it can come in handy?
|
|
||||||
if ( ! function_exists( 'exif_imagetype' ) ) {
|
if ( ! function_exists( 'exif_imagetype' ) ) {
|
||||||
function exif_imagetype ( $filename ) {
|
function exif_imagetype ( $filename ) {
|
||||||
if ( ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false ) {
|
if ( ( list($width, $height, $type, $attr) = getimagesize( $filename ) ) !== false ) {
|
||||||
|
@ -31,7 +30,6 @@ if ( ! function_exists( 'exif_imagetype' ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
function ellipsis($str, $maxlen) {
|
function ellipsis($str, $maxlen) {
|
||||||
if (strlen($str) > $maxlen) {
|
if (strlen($str) > $maxlen) {
|
||||||
|
@ -205,6 +203,10 @@ class OC_Image {
|
||||||
* @returns bool.
|
* @returns bool.
|
||||||
*/
|
*/
|
||||||
public function fixOrientation() {
|
public function fixOrientation() {
|
||||||
|
if(!is_callable('exif_read_data')){
|
||||||
|
OC_Log::write('core','OC_Image::fixOrientation() Exif module not enabled.', OC_Log::DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(!is_resource(self::$resource)) {
|
if(!is_resource(self::$resource)) {
|
||||||
OC_Log::write('core','OC_Image::fixOrientation() No image loaded.', OC_Log::DEBUG);
|
OC_Log::write('core','OC_Image::fixOrientation() No image loaded.', OC_Log::DEBUG);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue