Beispiel #1
0
 /**
  * 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();
 }
 /**
  * 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);
 }