summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/HBPicture+UIAdditions.h1
-rw-r--r--macosx/HBPicture+UIAdditions.m14
-rw-r--r--macosx/HBPicture.h1
-rw-r--r--macosx/HBPicture.m5
4 files changed, 21 insertions, 0 deletions
diff --git a/macosx/HBPicture+UIAdditions.h b/macosx/HBPicture+UIAdditions.h
index e19d627d2..fffe3d9b7 100644
--- a/macosx/HBPicture+UIAdditions.h
+++ b/macosx/HBPicture+UIAdditions.h
@@ -13,6 +13,7 @@
* UI enabled bindings
*/
@property (nonatomic, readonly) NSString *info;
+@property (nonatomic, readonly) NSString *sourceInfo;
@property (nonatomic, readonly) NSString *summary;
@property (nonatomic, readonly) int maxWidth;
diff --git a/macosx/HBPicture+UIAdditions.m b/macosx/HBPicture+UIAdditions.m
index 06ea316ee..87759ad74 100644
--- a/macosx/HBPicture+UIAdditions.m
+++ b/macosx/HBPicture+UIAdditions.m
@@ -84,6 +84,20 @@
return sizeInfo;
}
+- (NSString *)sourceInfo
+{
+ NSString *sizeInfo = @"";
+
+ sizeInfo = [NSString stringWithFormat:@"%d x %d", self.sourceWidth, self.sourceHeight];
+
+ if (self.sourceWidth != self.sourceDisplayWidth)
+ {
+ sizeInfo = [NSString stringWithFormat:@"%d x %d, Anamorphic: %d x %d", self.sourceWidth, self.sourceHeight, self.sourceDisplayWidth, self.sourceHeight];
+ }
+
+ return sizeInfo;
+}
+
- (NSString *)summary
{
NSMutableString *summary = [NSMutableString stringWithString:@""];
diff --git a/macosx/HBPicture.h b/macosx/HBPicture.h
index a717a4c69..c4773e822 100644
--- a/macosx/HBPicture.h
+++ b/macosx/HBPicture.h
@@ -48,6 +48,7 @@ extern NSString * const HBPictureChangedNotification;
*/
@property (nonatomic, readonly) int sourceWidth;
@property (nonatomic, readonly) int sourceHeight;
+@property (nonatomic, readonly) int sourceDisplayWidth;
@end
diff --git a/macosx/HBPicture.m b/macosx/HBPicture.m
index 43c1d7979..099a4c77a 100644
--- a/macosx/HBPicture.m
+++ b/macosx/HBPicture.m
@@ -345,6 +345,11 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
return self.sourceWidth / 2 - 2;
}
+- (int)sourceDisplayWidth
+{
+ return (int) (self.sourceWidth * self.sourceParNum / (double)self.sourceParDen);
+}
+
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
{
NSSet *retval = nil;