Latest 0.1.0
Homepage https://github.com/lucasecf/LEMirroredImagePicker
License MIT
Platforms ios 7.0, requires ARC
Authors

What is this

When using the UIImagePickerController, some of you must have noticed that, by default, the photo taken by the front camera is mirrored.

And even if you just invert the image taken in the delegate, the image displayed as preview by the UIImagePickerController will be still mirrored, resulting in a odd experience by the user.

See the example of UIImagePickerController’s default front camera photo below:

image 1image 2

And now used together with the LEMirroredImagePicker:

image 1image 2

Install

Manually

Drag and copy the two files in the LEMirroredImagePicker folder into your project, or add it as a git submodule.

CocoaPods

LEMirroredImagePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LEMirroredImagePicker"

How to use

LEMirroredImagePicker is ridiculously easy to use. All you need to do is invoke the two lines of code below:

#import "LEMirroredImagePicker.h"

(..)
@property(nonatomic) LEMirroredImagePicker *mirrorFrontPicker;
(..)

self.mirrorFrontPicker = [[LEMirroredImagePicker alloc] initWithImagePicker:pickerController];
[self.mirrorFrontPicker mirrorFrontCamera];

(..)

And thats it. Now the images taken by the front camera shown in the preview will be equal the ones the saw in the camera. See a complete example, with the UIImagePickerController, below:

UIImagePickerController *pickerController = [UIImagePickerController new];
pickerController.delegate = self;

if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
    pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    pickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
}
else
{
    pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}

self.mirrorFrontPicker = [[LEMirroredImagePicker alloc] initWithImagePicker:pickerController];
[self.mirrorFrontPicker mirrorFrontCamera];

[self presentViewController:pickerController animated:YES completion:nil];

Collaborate

Liked the project? Is there something missing or that could be better? Feel free to contribute :)

  1. Fork it

  2. Create your branch
    git checkout -b name-your-feature

  3. Commit it
    git commit -m 'the difference'

  4. Push it
    git push origin name-your-feature

  5. Create a Pull Request

Author

Lucas Eduardo, [email protected]

License

LEMirroredImagePicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LEMirroredImagePicker",
    "version": "0.1.0",
    "summary": "A simply class to mirror the image of front camera image picker",
    "homepage": "https://github.com/lucasecf/LEMirroredImagePicker",
    "license": "MIT",
    "authors": {
        "Lucas Eduardo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lucasecf/LEMirroredImagePicker.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "LEMirroredImagePicker": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This