Skip to content

Commit

Permalink
Refactored preview image.
Browse files Browse the repository at this point in the history
  • Loading branch information
kent013 committed May 28, 2012
1 parent 96a8d4d commit 416bb22
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tottepost/FlashView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <UIKit/UIKit.h>

@interface FlashView : UIView{
@interface FlashView : UIImageView{
NSTimeInterval flashInterval_;
float firstAlpha_;
}
Expand Down
1 change: 1 addition & 0 deletions tottepost/FlashView.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (id)initWithFrame:(CGRect)frame

// flash this view
-(void)flash{
self.image = nil;
self.alpha = firstAlpha_;
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
Expand Down
2 changes: 1 addition & 1 deletion tottepost/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ - (void) createCameraController{
imagePicker_.delegate = self;
imagePicker_.showsCameraControls = YES;
imagePicker_.showsShutterButton = NO;
imagePicker_.freezeAfterShutter = YES;
imagePicker_.freezeAfterShutter = NO;
if([PhotoSubmitterManager sharedInstance].isSquarePhotoRequired){
imagePicker_.showsSquareGrid = YES;
}
Expand Down
9 changes: 1 addition & 8 deletions tottepost/PreviewPhotoView.m
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,7 @@ - (void) presentWithContent:(PhotoSubmitterContentEntity *)content videoOrientat

if(content.isPhoto){
PhotoSubmitterImageEntity *photo = (PhotoSubmitterImageEntity *)content;

UIImage *image = photo.image.fixOrientation;
if(orientation == UIDeviceOrientationLandscapeLeft){
image = [image UIImageRotateByAngle:270];
}else if(orientation == UIDeviceOrientationLandscapeRight){
image = [image UIImageRotateByAngle:90];
}
imageView_.image = image.fixOrientation;
imageView_.image = [photo imageForPreviewWithOrientation:orientation];
[self addSubview:imageView_];
}else if(content.isVideo){
PhotoSubmitterVideoEntity *video = (PhotoSubmitterVideoEntity *)content;
Expand Down

0 comments on commit 416bb22

Please sign in to comment.