本文整理匯總了PHP中BitmapHandler::autoRotateEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP BitmapHandler::autoRotateEnabled方法的具體用法?PHP BitmapHandler::autoRotateEnabled怎麽用?PHP BitmapHandler::autoRotateEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BitmapHandler
的用法示例。
在下文中一共展示了BitmapHandler::autoRotateEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rotationEnabled
/**
* Should we rotate images in the preview on Special:Upload.
*
* This controls js: mw.config.get( 'wgFileCanRotate' )
*
* @todo What about non-BitmapHandler handled files?
*/
public static function rotationEnabled()
{
$bitmapHandler = new BitmapHandler();
return $bitmapHandler->autoRotateEnabled();
}
示例2: getRotation
/**
* On supporting image formats, try to read out the low-level orientation
* of the file and return the angle that the file needs to be rotated to
* be viewed.
*
* This information is only useful when manipulating the original file;
* the width and height we normally work with is logical, and will match
* any produced output views.
*
* @param File $file
* @return int 0, 90, 180 or 270
*/
public function getRotation($file)
{
if (!BitmapHandler::autoRotateEnabled()) {
return 0;
}
$data = $file->getMetadata();
return $this->getRotationForExif($data);
}