cgimagesource

Creating a thumbnail from UIImage using CGImageSourceCreateThumbnailAtIndex

梦想与她 提交于 2021-02-05 20:14:36
问题 I want to use the function CGImageSourceCreateThumbnailAtIndex to create a thumbnail from an UIImage . All I have is the UIImage itself. The image is the snapshot on a UIView . Please, I don't want to use any other method to create the thumbnail, just the one using CGImageSourceCreateThumbnailAtIndex , because I want to compare its performance with the other methods I already have. Said that, this is the code I have so far. I have create a UIImage category with this code: - (UIImage *

Creating a thumbnail from UIImage using CGImageSourceCreateThumbnailAtIndex

不想你离开。 提交于 2021-02-05 20:11:14
问题 I want to use the function CGImageSourceCreateThumbnailAtIndex to create a thumbnail from an UIImage . All I have is the UIImage itself. The image is the snapshot on a UIView . Please, I don't want to use any other method to create the thumbnail, just the one using CGImageSourceCreateThumbnailAtIndex , because I want to compare its performance with the other methods I already have. Said that, this is the code I have so far. I have create a UIImage category with this code: - (UIImage *

CFURLCreateDataAndPropertiesFromResource failed with error code -15

心不动则不痛 提交于 2019-12-25 03:16:52
问题 I'm trying to lead a TIFF image into a CGImageSource using CGImageSourceCreateWithURL. My URL is correct, is %20 encoded, is a path to an existing file, that file is a TIFF. However, the line: NSString *fullPath = [[[fileNames objectAtIndex:pageNum - 1] string] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString* urlStr = [NSString stringWithFormat: @"file:/%@", fullPath]; NSURL * url = [NSURL URLWithString: fullPath]; CGImageSourceRef src = CGImageSourceCreateWithURL

How to load a self-made TIFF image file from NSDocumentsDirectory

六眼飞鱼酱① 提交于 2019-12-12 05:59:23
问题 When trying to load files from the NSDocumentsDirectory of an iPhone, I cannot create the image source with the path string I have. I get the error message " <Error>: ImageIO: CGImageSourceCreateWithURL CFURLCreateDataAndPropertiesFromResource failed with error code -15. ", which is a kCFURLImproperArgumentsError . However, I cannot find what "proper" arguments might be. An example path would be: " /var/mobile/Applications/36D76BDF-72EC-4180-9246-CF1F50CF396C/Documents/2013080110555532Image

CGImageSourceRef imageSource = CGImageSourceCreateWithURL returns NULL

流过昼夜 提交于 2019-12-12 02:54:54
问题 I want to get the Size of the image without loading it so i am using the below code -(float)gettingimagedimensions:(NSString*)url{ NSURL *imageFileURL = [NSURL fileURLWithPath:url]; //CGImageSourceRef imageSource = CGImageSourceCreateWithURL(imageFileURL, NULL); CGImageSourceRef imageSource = CGImageSourceCreateWithURL((__bridge CFURLRef)imageFileURL, NULL); if (imageSource == NULL) { // Error loading image return 0; } CGFloat width = 0.0f, height = 0.0f; CFDictionaryRef imageProperties =

CGImageSourceCreateWithURL returns always NULL

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 11:04:24
问题 I need to read the properties of an image without load or download it. In fact i have implemented a simple method that use the CGImageSourceCreateWithUrl for accomplish this. My problem is that it is returning always error because seems that the imageSource is null. So what can i do for fix it? In the NSURL object i pass urls like: "http://www.example.com/wp-content/uploads/image.jpg" but also ALAssets library Id used to retrieve images inside the phone like "assets-library://asset/asset.JPG

Using CGImageProperties to get EXIF properties

淺唱寂寞╮ 提交于 2019-12-10 14:47:09
问题 I want to be able to add a text comment to the metadata of a JPEG and be able to read it back from within an iphone app. I thought this would be fairly simple as ios4 contains support for EXIF info. So I added metadata using a Windows tool called used AnalogExif and read it back from my app using: NSData *jpeg = UIImageJPEGRepresentation(myUIImage,1.0); CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)jpeg, NULL); NSDictionary *metadata = (NSDictionary *)