@@ -80,7 +80,7 @@ int DecodeImageFromFile(const char *uri, unsigned int frame, REBCDI *codi)
80
80
pixels = (UInt32 *)malloc (w * h * 4 ); // Rebol's library side must free it!
81
81
ASSERT_NOT_NULL (pixels, 4 , " allocate pixels buffer" );
82
82
space = CGColorSpaceCreateDeviceRGB ();
83
- ctx = CGBitmapContextCreate (pixels, w, h, bitsPerComponent, bytesPerPixel * w, space, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big );
83
+ ctx = CGBitmapContextCreate (pixels, w, h, bitsPerComponent, bytesPerPixel * w, space, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little );
84
84
ASSERT_NOT_NULL (ctx, 5 , " create a bitmap context" );
85
85
CGContextDrawImage (ctx, CGRectMake (0 , 0 , w, h), img);
86
86
CGColorSpaceRelease (space);
@@ -126,7 +126,7 @@ int EncodeImageToFile(const char *uri, REBCDI *codi)
126
126
data = CGDataProviderCreateWithData (NULL , codi->bits , codi->w * codi->h * 4 , NULL );
127
127
ASSERT_NOT_NULL (data, 1 , " prepare input data" );
128
128
colorSpace = CGColorSpaceCreateDeviceRGB ();
129
- img = CGImageCreate (codi->w , codi->h , 8 , 32 , codi->w * 4 , colorSpace, (kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big ), data, NULL , TRUE , 0 );
129
+ img = CGImageCreate (codi->w , codi->h , 8 , 32 , codi->w * 4 , colorSpace, (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little ), data, NULL , TRUE , 0 );
130
130
CGDataProviderRelease (data);
131
131
CGColorSpaceRelease (colorSpace);
132
132
ASSERT_NOT_NULL (img, 2 , " create an image" );
0 commit comments