How to detect orientation change in layout in Flutter?

In order to determine the Orientation of the screen, we can use the OrientationBuilder Widget. The OrientationBuilder will determine the current Orientation and rebuild when the Orientation changes. new OrientationBuilder( builder: (context, orientation) { return new GridView.count( // Create a grid with 2 columns in portrait mode, or 3 columns in // landscape mode. crossAxisCount: … Read more

PHP read_exif_data and Adjust Orientation

Based on Daniel’s code I wrote a function that simply rotates an image if necessary, without resampling. GD function image_fix_orientation(&$image, $filename) { $exif = exif_read_data($filename); if (!empty($exif[‘Orientation’])) { switch ($exif[‘Orientation’]) { case 3: $image = imagerotate($image, 180, 0); break; case 6: $image = imagerotate($image, 90, 0); break; case 8: $image = imagerotate($image, -90, 0); break; … Read more

iOS – UIImageView – how to handle UIImage image orientation

If I understand, what you want to do is disregard the orientation of the UIImage? If so then you could do this: UIImage *originalImage = [… whatever …]; UIImage *imageToDisplay = [UIImage imageWithCGImage:[originalImage CGImage] scale:[originalImage scale] orientation: UIImageOrientationUp]; So you’re creating a new UIImage with the same pixel data as the original (referenced via its … Read more

Android, how to not destroy the activity when I rotate the device?

For API 12 and below: add android:configChanges=”orientation” Add “screenSize” if you are targeting API 13 or above because whenever your orientation changes so does your screen size, otherwise new devices will continue to destroy your activity. See Egg’s answer below for more information on using “screenSize” android:configChanges=”orientation|screenSize” to your Activity in AndroidManifest.xml. This way your … Read more

How to set Android camera orientation properly?

From other member and my problem: Camera Rotation issue depend on different Devices and certain Version. Version 1.6: to fix the Rotation Issue, and it is good for most of devices if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { p.set(“orientation”, “portrait”); p.set(“rotation”,90); } if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { p.set(“orientation”, “landscape”); p.set(“rotation”, 90); } Version 2.1: depend on kind … Read more

Getting device orientation in Swift

you can use: override func didRotateFromInterfaceOrientation(fromInterfaceOrientation: UIInterfaceOrientation) { var text=”” switch UIDevice.currentDevice().orientation{ case .Portrait: text=”Portrait” case .PortraitUpsideDown: text=”PortraitUpsideDown” case .LandscapeLeft: text=”LandscapeLeft” case .LandscapeRight: text=”LandscapeRight” default: text=”Another” } NSLog(“You have moved: \(text)”) } SWIFT 3 UPDATE override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) { var text=”” switch UIDevice.current.orientation{ case .portrait: text=”Portrait” case .portraitUpsideDown: text=”PortraitUpsideDown” case .landscapeLeft: text=”LandscapeLeft” case … Read more

How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

Jeremy Keith (@adactio) has a good solution for this on his blog Orientation and scale Keep the Markup scalable by not setting a maximum-scale in markup. <meta name=”viewport” content=”width=device-width, initial-scale=1″> Then disable scalability with javascript on load until gesturestart when you allow scalability again with this script: if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) { var viewportmeta = … Read more

What is the “right” way to handle orientation changes in iOS 8?

Apple recommends using size classes as a coarse measure of how much screen space is available, so that your UI can significantly change its layout and appearance. Consider that an iPad in portrait has the same size classes as it does in landscape (Regular width, Regular height). This means that your UI should be more … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)