问题标签 [uiimageorientation]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
iphone - 从照片库图像中获取正确的图像方向属性
在我的 iPhone 应用程序中,我使用 PhotoLibrary 中的 UIImagePickerController 拍摄图像。如何获得正确的 imageOrientation 属性?
更新无论如何我都会得到 UIImageOrientationUp
android - 以纵向模式拍照时图像旋转
我已经实现了一个自定义相机,我从中拍照,将其保存到媒体存储中并在之后立即显示。我一直受到保存图像方向问题的困扰,我尝试使用 ExifInterface 使用filePath 直接或使用来自 Android 图像内容提供程序的方向。
方向始终返回为 0。我已经使用过:
从画廊方向选择的 Android 图像始终为 0:Exif TAG
编辑:
当我在横向模式下拍照时,输出图像已经正确显示,但是在纵向模式下拍照时它返回一个旋转的图像(90度)。我目前正在使用基于 EXIF 的方法。
ios - 横向使用 UIImagePickerController
我正在创建一个处于横向模式的应用程序,我正在使用其中UIImagePickerController
的 iPhone 相机拍照,我也想在横向模式下创建它。
但是正如 Apple 文档所暗示的那样UIImagePickerController
,它不支持横向,那么我应该怎么做才能获得所需的功能呢?
ios - 从相机拍摄的 iOS 缩放图像
我正在尝试编写代码,用户可以从他们的相机拍摄照片,然后它将显示在指定的 UIImageView 内,并上传到服务器以供以后用户使用。我使用 iPad 作为设备。但是,当用户拍照时,它会旋转 90 度。此外,它的比例是错误的。长宽比与拍摄的照片不同。这是我用来缩放和调整大小的代码:http: //pastebin.com/HxNkb7Be
将文件上传到我的服务器时,我得到图像的数据,如下所示:
这就是我从相机获取 UIImage 的方式:
ios7 - iOS 7 中的图像方向
上面的代码在 iOS 6 中运行良好,但在 iOS 7 中不旋转图像。
我得到了 imageOrientation 的正确值,但静止图像不旋转。
知道为什么吗?
谢谢。
ios - 如何用从 AVCaptureDevice 捕获的 NSData 和 NSDictionary 组成一个“正确”的 UIImage?
我正在使用 AVCaptureDevice 从相机捕获图像。设置会话并捕获图像后,我可以获得 aNSData *
和一个NSDictionary *
对象,但是,由于 EXIF 元数据和数据的分离,当我尝试将其转换为NSData *
并将UIImage *
其放入 aUIImageView *
时,图像方向错误。
我知道我可以使用很多修复方法来获得正确的图像,我现在正在这样做,但问题是,当图像分辨率很高(即 3000 * 4000)时,修复方法很慢,我的 iPhone5 大约需要 500 毫秒。在使用仪器运行时间分析器之后,大部分时间都花在了写入数据上,我猜这是不可避免的。
所以我想知道我在做正确的事吗?难道不应该有一种更简单但更有效的方法来解决这样的问题吗?请帮我离开这里,非常感谢!
ios - 需要另一种旋转图像的方法
我有一个非常适合旋转图像的方法实现。唯一的问题是它一直在控制台中导致内存警告,并且由于内存压力导致我的应用程序崩溃。
我需要找到一种新方法,可以达到相同的结果,但不会导致内存问题或应用程序崩溃。
这是我现在正在使用的方法实现:
导致90%内存问题的具体说法是:
因此,解决方案可能是该语句的替代品,或者是全新的方法实现。
谢谢您的帮助。
ios - Images from iOS camera are sent rotated in web application
I am building an application in HTML5 for iPad to upload a picture to a server. When I click an input file element like this:
It gives the possibility to either take a picture from the device camera or to upload from existing ones. However, when taking a picture, the resulting image is rotated based on the orientation of the device at the moment the photo is taken. What I want to do is to figure out the orientation of the captured image and try to rotate it on the server-side.
Notice that I do not have access to any iOS tools or frameworks, since this application is totally web-based.
Then, is there any information regarding the orientation of the picture that I can either access on the client or on the server-side, such that I would be able to rotate the images into the proper position? I have heard of EXIF data, but I am unsure on how to access it, and if it would give me the required information.
I am using python on the server-side, but a solution in C/C++ would also be appreciated.
Thanks.
ios - UIImagePickerController camera automatically converts image to portraitup
I have called a UIImagePickerController
to take a photo but every time I take a photo, the camera automatically convert the image to portrait up although I want to take the image in the orientation it was taken.
In the didFinishPickingMediaWithInfo
method, the returned image has the orientation UIImageOrientationUp
every time.
In my parent controller, I have the following code:
uiimagepickercontroller - UIImageOrientation/UIImagePickerController
我正在使用相机在 IOS 应用程序中拍照。它有效,我唯一遇到的问题是当我试图弄清楚用户在拍照时是如何握住设备的。
如果我能以适当的方式显示图像,而不是倒置或旋转 90 度,那就更好了。
寻找解决方案使我发现我应该使用 UIImage 的 imageOrientation 但实际上:
我错过了什么?
我做了各种研究和实验,但没有任何改变。此时我不再显示任何代码,原因很简单,我不知道显示哪个部分来帮助找到问题。