Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 510 by timot...@
gmail.com: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510I was hopeful when I saw the latest version supports XCFrameworks, but I'm having issues with simulator builds still.
What steps will reproduce the problem?
1. Add WebP.xcframework to project
2. Add extension below
3. Compile for the simulator on an M1 Mac
4. Build fails with `Undefined symbol: _WebPGetInfo` and `Undefined symbol: _WebPDecodeRGBA`
What is the expected output? What do you see instead?
Successful build
What version of the product are you using? On what operating system?
1.2.0 iOS xcframework
Please provide any additional information below.
Use this extension on UIImage:
#import <WebP/decode.h>
+ (UIImage *)imageWithWebPData:(NSData *)imgData {
// Get width and height of the selected WebP image
int width = 0, height = 0;
WebPGetInfo(imgData.bytes, imgData.length, &width, &height);
//NSLog(@"Image Width: %d Height: %d", width, height);
// Decode the WebP image data into a RGBA value array
uint8_t *data = WebPDecodeRGBA(imgData.bytes, imgData.length, &width, &height);
// Construct a UIImage from the decoded RGBA value array
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, data,
width * height * 4, free_image_data);
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault |
kCGImageAlphaLast;
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
CGImageRef imageRef = CGImageCreate(width, height, 8, 32, 4 * width,
colorSpaceRef, bitmapInfo, provider, NULL, YES, renderingIntent);
UIImage *result = [UIImage imageWithCGImage:imageRef];
// Clean up
CGImageRelease(imageRef);
CGColorSpaceRelease(colorSpaceRef);
CGDataProviderRelease(provider);
return result;
}
--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings