Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

display jpeg2000 in ios 4.3

I am using IOS sdk 4.3

I want to use jpeg200 images in my project and want to display it .


Would anyone help me?


Thanks.

iPad, iOS 4.3

Posted on Jan 11, 2012 4:28 AM

Reply
Question marked as Best reply

Posted on Jan 11, 2012 5:54 AM

JPEG 2000 is already supported.

14 replies

Jan 12, 2012 5:28 AM in response to K T

I read the documents and try to retrive image from a jp2 file.I used the code written below




CGImageRef img=[self MyCreateCGImageFromFile:@"/Users/pacs/Desktop/JP2Files/a1.jp2"];


- (CGImageRef) MyCreateCGImageFromFile 😟NSString *) path

{

// Get the URL for the pathname passed to the function.


NSURL *url = [NSURL fileURLWithPath:path];

CGImageRef myImage = NULL;

CGImageSourceRef myImageSource;

CFDictionaryRef myOptions = NULL;

CFStringRef myKeys[2];


CFTypeRef myValues[2];

// Set up options if you want them. The options here are for

// caching the image in a decoded form and for using floating-point

// values if the image format supports them.

myKeys[0] = kCGImageSourceShouldCache;

myValues[0] = (CFTypeRef)kCFBooleanTrue;

myKeys[1] = kCGImageSourceShouldAllowFloat;

myValues[1] = (CFTypeRef)kCFBooleanTrue;

// Create the dictionary

myOptions = CFDictionaryCreate(NULL, (const void **) myKeys,

(const void **) myValues,

2,

&kCFTypeDictionaryKeyCallBacks,

&kCFTypeDictionaryValueCallBacks);


// Create an image source from the URL.

myImageSource = CGImageSourceCreateWithURL((CFURLRef)url, myOptions);




if (myImageSource == NULL)

{

fprintf(stderr, "Image source is NULL.");

return NULL;

}


// Create an image from the first item in the image source.


myImage = CGImageSourceCreateImageAtIndex(myImageSource,

0,

NULL);



// CFRelease(myImageSource);

// Make sure the image exists before continuing

if (myImage == NULL)

{

fprintf(stderr, "Image not created from image source.");

return NULL;

}

return myImage;

}




But it is showing --Image not created from image source

I am not able to know where the error is .


Would you please hepl me ?

Jan 17, 2012 12:41 AM in response to etresoft

The images support in xcode 4.2 and ios5 are


<CFArray 0x6e30580 [0x1337b38]>{type = mutable-small, count = 36, values = (

0 : <CFString 0x2741e0 [0x1337b38]>{contents = "public.png"}

1 : <CFString 0x2741c0 [0x1337b38]>{contents = "public.jpeg"}

2 : <CFString 0x274280 [0x1337b38]>{contents = "com.compuserve.gif"}

3 : <CFString 0xe24e9f4 [0x1337b38]>{contents = "com.canon.tif-raw-image"}

4 : <CFString 0xe24ec04 [0x1337b38]>{contents = "com.adobe.raw-image"}

5 : <CFString 0xe24e954 [0x1337b38]>{contents = "com.canon.cr2-raw-image"}

6 : <CFString 0xe24ebf4 [0x1337b38]>{contents = "com.leafamerica.raw-image"}

7 : <CFString 0xe24ec14 [0x1337b38]>{contents = "com.hasselblad.fff-raw-image"}

8 : <CFString 0xe24ec24 [0x1337b38]>{contents = "com.hasselblad.3fr-raw-image"}

9 : <CFString 0xe24fb34 [0x1337b38]>{contents = "com.nikon.raw-image"}

10 : <CFString 0xe24fb44 [0x1337b38]>{contents = "com.nikon.nrw-raw-image"}

11 : <CFString 0xe24eaa4 [0x1337b38]>{contents = "com.pentax.raw-image"}

12 : <CFString 0xe24fb54 [0x1337b38]>{contents = "com.samsung.raw-image"}

13 : <CFString 0xe24ea94 [0x1337b38]>{contents = "com.sony.raw-image"}

14 : <CFString 0xe24faa4 [0x1337b38]>{contents = "com.sony.sr2-raw-image"}

15 : <CFString 0xe24ea84 [0x1337b38]>{contents = "com.sony.arw-raw-image"}

16 : <CFString 0xe24fb24 [0x1337b38]>{contents = "com.epson.raw-image"}

17 : <CFString 0xe24ec34 [0x1337b38]>{contents = "com.kodak.raw-image"}

18 : <CFString 0x2738e0 [0x1337b38]>{contents = "public.tiff"}

19 : <CFString 0x2742a0 [0x1337b38]>{contents = "com.microsoft.ico"}

20 : <CFString 0x2742c0 [0x1337b38]>{contents = "com.microsoft.bmp"}

21 : <CFString 0x274200 [0x1337b38]>{contents = "public.xbitmap-image"}

22 : <CFString 0x2742b0 [0x1337b38]>{contents = "com.microsoft.cur"}

23 : <CFString 0x2742e0 [0x1337b38]>{contents = "com.truevision.tga-image"}

24 : <CFString 0x2741d0 [0x1337b38]>{contents = "public.jpeg-2000"}

25 : <CFString 0x2741c0 [0x1337b38]>{contents = "public.jpeg"}

26 : <CFString 0xe24ea74 [0x1337b38]>{contents = "com.canon.crw-raw-image"}

27 : <CFString 0xe24e9e4 [0x1337b38]>{contents = "com.fuji.raw-image"}

28 : <CFString 0xe24e9a4 [0x1337b38]>{contents = "com.panasonic.raw-image"}

29 : <CFString 0xe24e9b4 [0x1337b38]>{contents = "com.panasonic.rw2-raw-image"}

30 : <CFString 0xe24e9c4 [0x1337b38]>{contents = "com.leica.raw-image"}

31 : <CFString 0xe24e9d4 [0x1337b38]>{contents = "com.leica.rwl-raw-image"}

32 : <CFString 0xe24e964 [0x1337b38]>{contents = "com.konicaminolta.raw-image"}

33 : <CFString 0xe24e994 [0x1337b38]>{contents = "com.olympus.sr-raw-image"}

34 : <CFString 0xe24e984 [0x1337b38]>{contents = "com.olympus.or-raw-image"}

35 : <CFString 0xe24e974 [0x1337b38]>{contents = "com.olympus.raw-image"}

)}

<CFArray 0x6a2ca80 [0x1337b38]>{type = mutable-small, count = 9, values = (

0 : <CFString 0x2741e0 [0x1337b38]>{contents = "public.png"}

1 : <CFString 0x2741c0 [0x1337b38]>{contents = "public.jpeg"}

2 : <CFString 0x274280 [0x1337b38]>{contents = "com.compuserve.gif"}

3 : <CFString 0x2738e0 [0x1337b38]>{contents = "public.tiff"}

4 : <CFString 0x2742a0 [0x1337b38]>{contents = "com.microsoft.ico"}

5 : <CFString 0x2742c0 [0x1337b38]>{contents = "com.microsoft.bmp"}

6 : <CFString 0x274250 [0x1337b38]>{contents = "com.adobe.pdf"}

7 : <CFString 0x2742e0 [0x1337b38]>{contents = "com.truevision.tga-image"}

8 : <CFString 0x2741d0 [0x1337b38]>{contents = "public.jpeg-2000"}

)}




I think ios 5 can display jpeg2000 images without adding any extra library.

display jpeg2000 in ios 4.3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.