zoukankan      html  css  js  c++  java
  • 随记(五)--上传图片耗时问题

     1 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 

    使用UIImagePNGRepresentation取到的图片可能会出现卡顿的现象

     在iPhone上有两种读取图片数据的方法:UIImagePNGRepresentation与UIImageJPEGRepresentation;其中UIImagePNGRepresentation方法耗时比较长,UIImageJPEGRepresentation方法耗时比较少

    图片上传到服务器时,也必须对图片进行压缩处理,免得上传服务器时会出现很耗时的现象,用户体验起来很不爽。

    UIImagePNGRepresentation只需要图片引用作为参数,压缩质量不是很好,上传比较耗时,是PNG格式;

    UIImageJPEGrepresentation需要两个参数,图片引用及压缩系数,而压缩系数为1.0,是不压缩,总体上传耗时比较少,是JPG格式

  • 相关阅读:
    LeetCode.152
    python
    python
    python
    python
    python
    python
    python
    PyCharm2020.1激活码破解教程
    Python GUI编程(Tkinter)17、Menu鼠标右键菜单
  • 原文地址:https://www.cnblogs.com/1394389856fei/p/5344902.html
Copyright © 2011-2022 走看看