diff options
Diffstat (limited to 'macosx/HBPicture+UIAdditions.m')
-rw-r--r-- | macosx/HBPicture+UIAdditions.m | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/macosx/HBPicture+UIAdditions.m b/macosx/HBPicture+UIAdditions.m index 21b92d851..9223a47f1 100644 --- a/macosx/HBPicture+UIAdditions.m +++ b/macosx/HBPicture+UIAdditions.m @@ -91,7 +91,35 @@ - (NSString *)shortInfo { - return [NSString stringWithFormat:NSLocalizedString(@"%dx%d Storage, %dx%d Display", nil), self.width, self.height, self.displayWidth, self.height]; + return [NSString stringWithFormat:NSLocalizedString(@"%dx%d Storage, %dx%d Display\n %d : %d PAR, %@ DAR", nil), + self.width, self.height, self.displayWidth, self.height, + self.parWidth, self.parHeight, [self displayAspectInfo]]; +} + +- (NSString *)displayAspectInfo +{ + int dar_width, dar_height; + NSString *str; + + hb_reduce(&dar_width, &dar_height, self.displayWidth, self.height); + int iaspect = dar_width * 9 / dar_height; + if (dar_width > 2 * dar_height) + { + str = [NSString stringWithFormat:@"%.2g : 1", (double)dar_width / dar_height]; + } + else if (iaspect <= 16 && iaspect >= 15) + { + str = [NSString stringWithFormat:@"%.2g : 9", (double)dar_width * 9 / dar_height]; + } + else if (iaspect <= 12 && iaspect >= 11) + { + str = [NSString stringWithFormat:@"%.2g : 3", (double)dar_width * 3 / dar_height]; + } + else + { + str = [NSString stringWithFormat:@"%d : %d", dar_width, dar_height]; + } + return str; } - (NSString *)sourceInfo |