DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Much Improved Apple PhotoScroller

Alex Curylo user avatar by
Alex Curylo
·
Feb. 29, 12 · Interview
Like (0)
Save
Tweet
Share
5.77K 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

  • What Are the Different Types of API Testing?
  • Kubernetes-Native Development With Quarkus and Eclipse JKube
  • How To Select Multiple Checkboxes in Selenium WebDriver Using Java
  • Journey to Event Driven, Part 1: Why Event-First Programming Changes Everything

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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: