Questions tagged [cgimagesource]

27 questions
9
votes
1 answer

CGImageSource to CGImage?

I got this following code that access a PHAsset. I need to pass a CGImage out of this: let imageManager = PHImageManager.defaultManager() imageManager.requestImageDataForAsset(self.asset!, options: nil, resultHandler:{ (data, responseString,…
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
6
votes
4 answers

Creating a thumbnail from UIImage using CGImageSourceCreateThumbnailAtIndex

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…
Duck
  • 34,902
  • 47
  • 248
  • 470
6
votes
1 answer

Wrong rotation when loading image using CGImageSourceRef

I load images in a C++ library using the code below. When loading some images the rotation of the image is wrong. It seems to affect JPEGs that come from the iPhone camera. How do I fix this? Presumably there is a flag somewhere that gets set for…
Robotbugs
  • 4,307
  • 3
  • 22
  • 30
5
votes
1 answer

Using CGImageProperties to get EXIF properties

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…
user930731
  • 145
  • 1
  • 3
  • 5
5
votes
0 answers

Intermittent crash on CFRelease() called with NULL for some JPG images

In my iOS app, I download game assets from s3. My artist updated one of the assets, and we immediately started seeing crashes with the new asset. Here's the code that processes them: + (UIImage *)imageAtPath:(NSString *)imagePath…
commanda
  • 4,841
  • 1
  • 25
  • 34
4
votes
3 answers

How to inject exif metadata into an image, without copying the image?

I have previously asked this question: How to write exif metadata to an image. I now have found a way to inject metadata. However, it results in a copy of the image into memory. With large images, and the need to already have a copy in memory, this…
akaru
  • 6,299
  • 9
  • 63
  • 102
3
votes
2 answers

How to create a CGImageSourceRef from image raw data?

How to create a CGImageSourceRef from raw data? I have one file that consists only of the pixel information of an image. I know the resolution and the depth and so on (e.g. 640x860, RGB, 8bit, orientation = 1, DPI = 300). These informations aren't…
3ef9g
  • 781
  • 2
  • 9
  • 19
3
votes
2 answers

CGImageSourceCreateWithURL returns always NULL

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…
Hieicker
  • 595
  • 1
  • 11
  • 29
3
votes
1 answer

CGImageSourceRef memoryleak

NSDictionary* result = nil; CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)[self TIFFRepresentation], NULL); if ( NULL == source ) { } else { CFDictionaryRef metadataRef = CGImageSourceCopyPropertiesAtIndex (source,…
Tuan
  • 893
  • 1
  • 9
  • 24
3
votes
2 answers

How to get the image size of an image file in monotouch without loading it?

How to get the image size of an image file in monotouch without loading it in memory? I tried to use CGImageSource from the MonoTouch.ImageIO namespace, as indicated in the Apple documentation and in this blog post: oleb.net But this code doesn't…
Emanuele Sabetta
  • 1,571
  • 12
  • 34
2
votes
0 answers

add/modify/edit the photo's exif in swift

I am building an app which can add/modify/edit the exif after the photo filtered. The photo miss all the exif after adding filter. I have try added the new exif to the photo by attempting using the code below, which is not work. The exif still blank…
andyagul
  • 21
  • 2
2
votes
1 answer

Extract image picture style from metadata

I'm using the ios CGImageSourceCopyPropertiesAtIndex to extract a lot of metadata for images on ios. But I cannot extract all metadata like the ones shown in Mac Preview app or the exiftool command. I'm missing the "Picture Style" and "Canon"…
stoffer
  • 2,317
  • 2
  • 18
  • 24
1
vote
1 answer

How to create CGColorSpace from EXIF number?

I have a CGImageSourceRef with a following metadata: // CGImageSourceCopyMetadataAtIndex ( exif:SubsecTimeDigitized = 000 exif:ColorSpace = 1 // and more ... ) // CGImageSourceCopyPropertiesAtIndex { …
olha
  • 2,132
  • 1
  • 18
  • 39
1
vote
1 answer

App Crash When I use CGImageSourceCreateThumbnailAtIndex in Swift

I just use CGImageSourceCreateThumbnailAtIndex to scale down UIImage size . I get crash Message : "IIONumber -- 'num' is not a CFNumberRef" . I could not find what is it? Thanks func scaleDownImage()->void{ var nextImage = UIImage() …
Anna
  • 181
  • 3
  • 8
1
vote
0 answers

UI Gets Blocked When Using CGImageSourceCreateWithURL and CGImageSourceCopyPropertiesAtIndex

I am checking the dimensions of images via their URLs stored in an array called destination_urls. I then calculate the height of images if they were stretched to the width of the screen while maintaining the aspect ratio. All of this is done in a…
1
2