修复:

1.动态获取空间图片的大小、尺寸
This commit is contained in:
bluesea 2024-03-07 10:43:48 +08:00
parent e2e16046ef
commit b5ebe769f1

View File

@ -86,9 +86,13 @@ class VRPhotoTransformController: BaseController {
print("这不是一张空间图片")
return
}
}
let imgWidth:CGFloat = mImgView?.image?.size.width ?? 0.0
let imgHeight:CGFloat = mImgView?.image?.size.height ?? 0.0
let imgSize:Int = sourceImageData?.count ?? 0
// size
let imgMbSize = Double(imgSize) / 1024 / 1024
let imgTitle = sourceImageURL?.pathComponents.last ?? "xx"
mBottomBtn = UIButton.init(type: UIButton.ButtonType.custom)
self.view.addSubview(mBottomBtn!)
mBottomBtn!.backgroundColor = UIColor.hexStringToColor(hexString: "#5326D6")
@ -130,7 +134,8 @@ class VRPhotoTransformController: BaseController {
mCenLab2!.textColor = UIColor.hexStringToColor(hexString: "#67617A")
mCenLab2!.font = UIFont.systemFont(ofSize: 12)
mCenView!.addSubview(mCenLab2!)
mCenLab2!.text = "00:00:03 · 10.9 MB"
mCenLab2!.text = "\(imgWidth) x \(imgHeight) · \(imgMbSize)"
mCenLab2!.text = String(format: "%.f x %.f · %.1f MB",imgWidth,imgHeight,imgMbSize)
mCenLab2!.sizeToFit()
if(mCenLab2!.width > mCenView!.width - 140){
mCenLab2!.width = mCenView!.width - 140
@ -149,7 +154,7 @@ class VRPhotoTransformController: BaseController {
mCenBtn!.right = mCenView!.width - 16
mCenBtn!.clipsToBounds = true
mCenBtn!.layer.cornerRadius = 10
mCenBtn!.setTitle("MV-HEVC", for: UIControl.State.normal)
mCenBtn!.setTitle("Spatial Photo", for: UIControl.State.normal)
mCenBtn!.setTitleColor(UIColor.white, for: UIControl.State.normal)
mCenBtn!.titleLabel?.font = UIFont.systemFont(ofSize: 12)