gpt4 book ai didi

javascript - phonegap 安卓相机 : crash when "correctOrientation" option set

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:39:46 34 4
gpt4 key购买 nike

我知道有人问过类似的问题,但我遇到了一个严重的问题。

任何使用过 phone gap 的人都知道这绝对不是应用程序解决方案的全部!

但这里是我的代码:

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
destinationType: destinationType.FILE_URI,
correctOrientation: true });

问题是当我添加 correctOrientation 时,我该死的应用程序出现某种内存泄漏,因为它关闭并出现错误。当我取出正确的方向参数时,它很好,除了方向错误的事实!有没有人有办法让我的照片的方向正确?

<?xml version="1.0" encoding="utf-8"?>

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />


<application android:icon="@drawable/icon" android:label="@string/app_name"
android:hardwareAccelerated="true"
android:debuggable="true">
<activity android:name="mysecond" android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>

最佳答案

谢谢大家,我明白了。如果 img 大小不是很大并且会导致内存溢出,则必须设置“目标大小”。我将目标宽度设置为 720,将质量设置为 50,一切正常,

关于javascript - phonegap 安卓相机 : crash when "correctOrientation" option set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14608455/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com