Re: iPhone Generating and displaying images using Bitmap
Re: iPhone Generating and displaying images using Bitmap
- Subject: Re: iPhone Generating and displaying images using Bitmap
- From: Shraddha Karwan <email@hidden>
- Date: Tue, 19 May 2009 11:36:36 +0530
Hi,
I get the following errors while displaying the JPEG buffered image.
<Error>: Corrupt JPEG data: 584 extraneous bytes before marker 0xc0
<Error>: Quantization table 0x00 was not defined
<Error>: Corrupt JPEG data: 446 extraneous bytes before marker 0xdb
<Error>: Bogus marker length
<Error>: CGImageCreate: invalid image size: 0 x 0.
What can be the cause for this error? Any ideas?
On Mon, May 18, 2009 at 8:33 PM, Gwynne Raskind <email@hidden>wrote:
> On May 18, 2009, at 4:03 AM, Shraddha Karwan wrote:
>
>> I have a buffer containing JPEG image data. I need to display this buffer
>> in
>> form of images. I copied this buffer to a file and then used the
>> following:
>>
>> CGDataProviderRef ref = CGDataProviderCreateWithFilename([appFile
>> UTF8String]);
>> CGImageRef imgRef =
>>
>> CGImageCreateWithJPEGDataProvider(ref,NULL,YES,kCGRenderingIntentSaturation);
>> UIImage *theImage = [[UIImage alloc] initWithCGImage:imgRef];
>>
>> Then displaying the image.
>> For some images I get the images but for some I get the JPEG Image corrupt
>> error message.
>> When I test the same data with Windows application it is able to display
>> the
>> image without any error.
>> Is my conversion from JPEG buffer to UIImage file appropriate or am I
>> missing out some thing?
>>
>
> Wouldn't:
>
> UIImage *theImage = [[UIImage alloc]
> initWithData:theJPEGDataBufferInMemory];
>
> Be simpler and more effective?
>
> That being said, your code looks correct. Can you give us the exact error
> message you get?
>
> -- Gwynne, Daughter of the Code
> "This whole world is an asylum for the incurable."
>
>
--
Regards,
Shraddha Karwan
Success usually comes to those who are too busy to be looking for it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden