简体   繁体   中英

How to upload images to azure without losing quality with image data swift

Currently, I am using below to upload an image in Azure blob

  let im:UIImage = catImage[i]
            let imageData = im.pngData()
            blob.upload(from: imageData!, completionHandler:{(NSError) -> Void in
                print( i , "uploaded")

                print(blob.metadata)
                print(i , imageData)
            })

but I am losing image quality because of pngdata(). What else I can use without losing quality.

Similar question here: UIImage to raw NSData / avoid compression

Trying to save a UIImage without compression.

这是我的图像选择器的一个问题,通过直接选择相位而不是图像来解决

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM