问题标签 [ios-camera]

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.

0 投票
1 回答
212 浏览

ios - 显示 iOS8 相机权限提示 - 但未使用相机

我最近更新到iOS8。在我的应用程序上,现在有一个相机权限对话框。我的应用程序中没有任何与相机相关的代码。(我有,但我几乎删除了它的所有内容)

我使用的框架

如何禁用此提示?任何提示可能导致这种情况?

谢谢

0 投票
2 回答
9925 浏览

ios - 从 iOS 8 设置启用相机访问时应用程序崩溃

我正在为 iPhone 开发一个应用程序,它使用相机扫描条形码和拍照。当我们没有相机访问权限并且用户启用了相机访问权限时,应用程序崩溃并重新打开。

你们能帮我解决这个问题吗?

提前致谢。

0 投票
2 回答
1401 浏览

javascript - 如何从 Titanium Appcelerator 中的 web 视图内部访问相机

我已经几乎完成了使用 Appcelerator 开发 HTML5 应用程序,我还有一个功能要添加,该功能允许用户在通过应用程序向客户端发送消息时拍照。显示了一个包含消息表单的特定 div,我希望用户能够用他们的手机拍照,并将其自动附加到消息上,然后将其提交到我们的服务器。

然而,在四处寻找之后,我对如何让它工作感到困惑。虽然 API 显示了使相机工作的 Javascript,但我似乎无法访问它,而且我不知道 API 调用应该位于何处。它是放在 app.js 文件中,还是它自己的文件中,或者在哪里调用它并不重要?任何帮助/建议将不胜感激。

编辑
感谢 Dragon,我对我的代码进行了以下更改:

index.html

应用程序.js

但是,在这种情况下,按钮可以很好地打开相机。但是,当照片被拍摄并被选中时,它会返回到屏幕但没有任何反应。然后它在调试中给出这个错误 - “Ti 未定义”。然后当我定义 Ti 时,它将返回“App 未定义”。

这样做的特殊之处在于,如果我删除将处理从 app.js 发送到 webview 的数据的代码,它工作正常,即使从 webview 打开相机的代码足够接近相同的代码?

0 投票
1 回答
359 浏览

ios - iPhone 6 Plus 使用 AVCaptureStillImageOutput.CaptureStillImageAsynchronously 的相机性能非常糟糕,为什么?

我们一直在使用 AVCaptureStillImageOutput.CaptureStillImageAsynchronously 在我们的应用程序中捕获 iOS 上的图像。在 iPhone 5、5c、5s 和 6 上,此调用使用 AVCaptureSession.PresetPhoto 设置大约需要 300-400 毫秒才能返回。在 iPhone 6 Plus 上,这需要 800-1250 毫秒。此相机问题仅存在于 iPhone 6 Plus 上。

为什么?我们已经查看了设置,但不清楚我们是否做错了什么。

我们还使用以下像素格式:CVPixelFormatType.CV48RGB

0 投票
0 回答
250 浏览

ios - Positioning a GPUImageView

I am using the wonderful GPUImage library to create a custom camera inside my app. In order to set the layout how I would like it I need to the preview portion of the view to be displayed towards the top of the view. Currently, the GPUImageView only will display at the center no matter how I adjust the crop of the GPUImageView frame.

I have read a few things on github (see below) about placing the GPUImageView inside another UIView in various ways but whenever I attempt some variation of [myUIView addSubview:GPUImageView] I get a variety of errors.

https://github.com/BradLarson/GPUImage/issues/600 -
https://github.com/BradLarson/GPUImage/issues/804 -

I am fairly new to all this so any code help would be greatly appreciated. This is my code without the added UIView I was attempting to place the GPUImageView into.

0 投票
1 回答
252 浏览

ios - 如何更改相机视图的高度和宽度(UIImagePickerViewController)iOS?

我想以矩形显示相机作为UItableViewCell扫描数字的一部分。

如何更改大小UIImagePickerViewController并将其添加为subview

0 投票
1 回答
4059 浏览

ios - 如何在 iOS8.1 上使用 Swift 按顺序拍摄多张照片(每张延迟 1 秒)?

在单个用户单击相机预览后,我尝试拍摄几张照片,以便我可以展示它们,并且用户可以选择时间最佳的照片或以“胶片”模式使用所有照片。预期的用户体验是:“我打开相机,拍照,然后我看到 5 张照片一秒一秒地拍摄。我不必按 5 次‘拍照’按钮,一张就足以启动序列” .

我是 iOS 和 Swift 的新手,我的工作基于“Swift 食谱”一书 ( https://www.safaribooksonline.com/library/view/ios-8-swift/9781491908969/ )。

拍摄单张照片的源代码是:

加上相关的图像处理(通过 func imagePickerController)。我尝试使用上面的控制器对象,但失败了:(我相信这不是获得我想要的东西的正确方法,但我很难找到合适的方法。任何帮助将不胜感激。

0 投票
1 回答
891 浏览

cordova - 科尔多瓦相机插件在 ios 8.1 中不起作用

目前我正在开发在 ios 8.1 上运行的 cordova(3.6) 应用程序。

Cameraplugin 总是返回下面给出的错误信息。

如何解决这个问题?

0 投票
0 回答
39 浏览

ios - 以 .jpg 格式存储图像

从应用程序中的相机捕获图像。我想将其保存为 .jpg 格式。但我不知道如何保存为.jpg?

我找到了两个方法 UIImagePNGRepresentation, UIImageJPEGRepresentation(TempImage, 0.5);

但我想以jpg格式保存。

0 投票
1 回答
539 浏览

ios - Swift Dictionary is nil when adding output settings

When accessing the camera and trying to capture a still, I get an error adding the output settings. It says that I can't add a nil to AVCaptureOutput

Here's the code:

This is the error:

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* Can't add a nil AVCaptureOutput'