本文整理汇总了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);
}