tags:

views:

41

answers:

3

I am building an apparel catalog on the iPad. The app will contain over 2000 jpg product images at 2048 x 1536 @ 72ppi, plus 2 sizes of thumbnails for each image. The large size of the primary images is to allow for zooming in on the products at reasonable resolution. The larger thumbnails will be displayed on each page to show alternate colors for each product. The smaller thumbnails are used in a side-scrolling pop-up filmstrip-style page browser.

I am dynamically resizing the larger thumbnails from the full-sized images as each page is displayed (in a paging UIScrollView). The smaller thumbnails are pre-rendered in photoShop to maximize the performance of the side-scrolling page browser.

Aside from the space taken up on the device from so many images, what other issues or concerns are there around the large number of images in an app like this? Memory management is under control because I am paging the large images in and out as needed as the user moves between pages in the main UIScrollView.

A: 

You are going to want to take a look at the PhotoScroller sample code. Those are mighty large images, and will cause your app to crash with the amount of memory they consume.

To page between pages, that means you'll have 2 images always loaded. If you can tile the images, I strongly suggest you do, that will further reduce your memory footprint.

Keep in mind that just because you can use say, 80 MB of memory for your application, does not mean you SHOULD use that much. Be a nice neighbour, your application will run along side other applications which themselves, use memory. Try and reduce your footprint however possible.

jer
When I run the app on the device with the performance tool and watch real memory usage in the activity monitor, I'm seeing 21Mb used. I'm jpging these images pretty aggressively, so file size of the full-sized images are around 250Kb each.
Alpinista
filesize does not equate to memory size. Total memory size for the contents of the framebuffer alone, is the resolution of the image, multiplied by 4 (rgba channels), irrespective of how much compression you have on the images.
jer
+1  A: 

If you are dealing with the large image memory management properly (by tiling) and your customers are aware of the sizes of the app and/or downloads then there really isn't much other concerns.

The iPad has enough processing power to handle this kind of image processing pretty swiftly, but I wouldn't expect this to run great on an older iPhone.

To prevent crashing, I would quadruple check that your memory management works the way you say it does, and that you definitely don't ship with NSZombieEnabled on.

coneybeare
A: 

In my opinion, if you're dealing with that much data you should build a hybrid app, and host all the images on a web server somewhere. An image that size can approach 1 MB: 1MB * 2000 images = 2 gigabytes of storage space on the phone consumed.

Sam Dufel
Actually, my file sizes are all less than 250k, so I'll be somewhere around .5 Gb all in. A web-based app would not have the performance needed, and would require an internet or 3G connection to work. By the way, this is not a consumer app. It will be used by a sales force selling in to wholesale customers on dedicated iPads used only for this app.
Alpinista