Skip to content

Images pasted into InputTextView have incorrect orientation #23

@nfogg

Description

@nfogg

I am having difficulty handling image orientations correctly in the InputTextView. Images attached from the Photos library or from the devices camera can appear sideways or upside down in the InputTextView. This is happening in MessageInputBar version 0.4.1.

I am attaching images from a UIImagePickerController with the following code:

extension ConversationViewController: UIImagePickerControllerDelegate {
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
        if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
            messageInputBar.inputTextView.pasteImageInTextContainer(with: image)
            dismiss(animated: true, completion: nil)
        }
    }
}

This problem can be reproduced using the ChatExample app in the simulator (iOS 12.1) with the following steps:

  1. From the simulator's Photos app, copy the flowers photo to the clipboard
  2. In the ChatExample app, paste the clipboard contents into the InputTextView

Note that the pasted image is upside down.

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions