照片旋转90度后,我采取github/fusuma开源



我使用的是来自github的fusuma项目。如果我选择照片从库与fusuma和上传它到我的服务器都是好的。但是如果我用fusuma相机拍照,它会旋转90度。我试着在php文件上旋转它但它旋转了所有照片。对于fusuma项目有什么解决方案吗?(迅速语言)

For Swift 3

func fixOrientation(_image:UIImage) -> UIImage {
    if (_image.imageOrientation == UIImageOrientation.up) {
        return _image;
    }
    UIGraphicsBeginImageContextWithOptions(_image.size, false, _image.scale);
    let rect = CGRect(x: 0, y: 0, width: _image.size.width, height: _image.size.height)
    _image.draw(in: rect)
    let normalizedImage : UIImage = UIGraphicsGetImageFromCurrentImageContext()!
    UIGraphicsEndImageContext();
    return normalizedImage;
}

Fusuma不支持横向,所以你需要假设它拍摄的每张照片都是纵向的。看到https://github.com/ytakzk/Fusuma/issues/50 issuecomment - 225333675

最新更新