Commits

makoto tsuyuki committed 8c0a2ea

bug fix(exif orientation)

Comments (0)

Files changed (3)

A6Softbaounds/A6Softbounds/Classes/A6Softbounds.h

 #define A6SOFTBOUNDS_OVERLAP       6.0f
 #define A6SOFTBOUNDS_OVERLAPPING  (A6SOFTBOUNDS_GROOVE + A6SOFTBOUNDS_OVERLAP) / (A6SOFTBOUNDS_A6_WIDTH+(A6SOFTBOUNDS_GROOVE*2))
 #define A6SOFTBOUNDS_ASPECT_RATIO ((A6SOFTBOUNDS_A6_WIDTH+(A6SOFTBOUNDS_GROOVE*2))-(A6SOFTBOUNDS_GROOVE+A6SOFTBOUNDS_OVERLAP)*2)/(A6SOFTBOUNDS_A6_HEIGHT+(A6SOFTBOUNDS_GROOVE*2))
-#define A6SOFTBOUNDS_PIECE_ASPECT_RATIO (111.0f / 154.0f) //((A6SOFTBOUNDS_A6_WIDTH+(A6SOFTBOUNDS_GROOVE*2))/(A6SOFTBOUNDS_A6_HEIGHT+(A6SOFTBOUNDS_GROOVE*2)))
+#define A6SOFTBOUNDS_PIECE_ASPECT_RATIO ((A6SOFTBOUNDS_A6_WIDTH+(A6SOFTBOUNDS_GROOVE*2))/(A6SOFTBOUNDS_A6_HEIGHT+(A6SOFTBOUNDS_GROOVE*2))) //(111.0f / 154.0f)
 #define A6SOFTBOUNDS_QUALITY 0.96f
 
 @interface A6Softbounds : NSObject <ApertureExportPlugIn>

A6Softbaounds/A6Softbounds/Classes/A6Softbounds.m

 	// Create a base URL
 	CFURLRef baseURLRef = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)[NSString stringWithFormat:@"%@/%@", _exportPath, path], kCFURLPOSIXPathStyle, true);
     NSURL* path_directory = [baseURLRef URLByDeletingLastPathComponent];
-	
-	// Create our full size CGImage from the provided data
-	CGImageSourceRef imageSourceRef = CGImageSourceCreateWithData((CFDataRef)imageData, NULL);
-	CGImageRef image = CGImageSourceCreateImageAtIndex(imageSourceRef, 0, NULL);
+
+	CGImageRef image;
+    
+    NSImage *im = [[NSImage alloc] initWithData:imageData];
+    NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:[im TIFFRepresentation]];
+	image = [bitmap CGImage];
+
     CFDictionaryRef* metadata = (CFDictionaryRef *)[[_exportManager propertiesWithoutThumbnailForImageAtIndex:index] retain];
     CFDictionarySetValue(metadata, kCGImageDestinationLossyCompressionQuality, [NSNumber numberWithFloat:A6SOFTBOUNDS_QUALITY]);
     float width = CGImageGetWidth(image);
     float height = CGImageGetHeight(image);
     
+    
     float image_aspect_ratio = width/height;
     //bool  landscape = (image_aspect_ratio > A6SOFTBOUNDS_ASPECT_RATIO); // more wide image.
     bool  landscape = (width > height);

release/A6Softbounds.ApertureExport/Contents/MacOS/A6Softbounds

Binary file modified.