user1688346
user1688346

Reputation: 1970

Image display options for IOS app

I am working on an IOS app that will display images uploaded by user from my website.

What is the best practices on re-sizing the images on mobile or server?

Option A - Resize thumbnail, desired size and stored it on a cloud server, Amazon S3 for example which host images for iphoneretina_ImgA, Iphone_ImgA, Ipad_ImgA, IphoneThumbnail_ImageA.

Option B - Resize to thumbnail, desired size on the device.

What is the best approach on displaying server image to iphone/ipad devices?

Upvotes: 1

Views: 126

Answers (1)

Rob
Rob

Reputation: 437552

You will get optimal performance on the device if you can do as much image processing on the server-side as possible and deliver optimally sized images to the device (i.e. smallest possible image to support the desired user interface), which will save not only download time (esp if user is on slower cellular networks) but also precious device memory and processing time (if you download high resolution images to device, the amount of CPU cycles and memory required to convert them to appropriate sized images or, worse, not resize them and try to let the poor ol' UIImageView try to render them).

In short, if you can do it server-side, that's ideal. If you do it on the device you'll suffer network bandwidth, memory consumption, and processing time on the device.

If the original images aren't too big, though, you can get away with some reasonable compromises which entail a modest device-side processing. For example, I'm interfacing with a legacy CMS system with modestly sized images and limited existing server-side image processing capabilities, so I just make my thumbnails on the device lazily as they're downloaded/required, but (a) the original images weren't huge; (b) I needed the original resolution images on the device anyway; and (c) I had to do some clever GCD (or you can use some other equivalent concurrent processing technology) to make sure the user interface wasn't too noticeably impacted as the app does one-time thumbnail generation (thumbnails that are then cached locally for optimal performance in the future).

As always in these cases, your final architecture will be a function of the particulars about your images, your server capabilities, the app requirements, but, if there's any rule of thumb, it would be do as much server-side as you can, balancing network bandwidth and server complexity issues with other demands on the device.

Upvotes: 1

Related Questions