DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > Much Improved Apple PhotoScroller

Much Improved Apple PhotoScroller

Alex Curylo user avatar by
Alex Curylo
·
Feb. 29, 12 · Mobile Zone · Interview
Like (0)
Save
Tweet
5.62K Views

Join the DZone community and get the full member experience.

Join For Free

Now this looks worth a serious look if you need to drop a downloadable photo gallery in somewhere — and who doesn’t?

Apple’s PhotoScroller sample code for iOS looks to many as a perfect starting place to display a scrolling list of photos that can each be zoomed significantly. It uses a CATiledLayer as a backing store so it does not have to load whole images into memory.

That said, after you see the three pretty jpeg images in the project, you lift up the covers and find approx 800 pre-tiles png files – its the pretiling of the jpegs that makes this project work.


Why, yes. Yes, we had noticed that.

So, I’ve taken that project and greatly enhanced it:

https://github.com/dhoerl/PhotoScrollerNetwork


And enhanced how? For instance,

- blazingly fast tile rendering – visually much much faster than Apple’s code (which uses png files in the file system)

- you supply a single jpeg file or URL and this code does all the tiling for you, quickly and painlessly

- provides the means to process very large images for use in a zoomable scrollview

- is backed by a CATiledLayer so that only those tiles needed for display consume memory

- each zoom level has one dedicated temp file rearranged into tiles for rapid tile access & rendering

- demonstrates how to use concurrent NSOperations to fetch several large images from the web or to process local image files

- the incremental approach uses mmap, only maps small parts of the image at a time, and does its processing as the image downloads and can thus handle very large images


That’s a pretty handy set of features for your large image display needs, isn’t it now?


Source: http://www.alexcurylo.com/blog/2012/02/27/photoscrollernetwork/

Memory (storage engine) Drops (app) Approx Fetch (FTP client)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • A Brief History of the DMCA
  • Getting Started With RSocket Kotlin
  • Introduction to JWT (Also JWS, JWE, JWA, JWK)
  • API Security Weekly: Issue 165

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo