Photo Inspector is an example application on how to capture and process high resolution photos (the resolution depends on the device hardware).
Capture a photo and slide your finger on the preview to bring up a loupe to zoom right into pixel perfect details in the photo. Save a lower resolution copy of the photo to the Photos gallery while retaining hidden copy of the original maximum resolution photo. Share photos as lower resolution copies to online services like Facebook and Twitter.
While the application works fine also on Windows Phone 8.1 devices with lower resolution cameras (like Nokia Lumia 620), the main purpose of Photo Inspector is to demonstrate the high resolution camera capabilities of Nokia Lumia PureView devices and to give an example on how you can capture and process high resolution photos in your own applications.
Photo Inspector is compatible with Windows Phone 8.1 devices, and it uses the Nokia Imaging SDK.
Using the prebuilt installation package
Download the XAP file and install it on your device by using the Application Deployment tool that comes with the Windows Phone 8.1 SDK.
Building the application
Download the application solution source code and open the MagnifierApp.sln file in the Microsoft Visual Studio Express 2013 for Windows. Set target to Device and ARM and start building and running the application by hitting F5 or by selecting Start Debugging from the Debug menu.
Photo Inspector launches to a page displaying previously captured and re-framed photos that are saved in the device Pictures library. Only photos in Camera Roll and re-framed photos in Saved pictures folder are shown. For re-framed photos a small icon is displayed. This icon indicates that the original high resolution photo is available for re-framing the photo again.
In the viewfinder the camera is always set to capture highest possible resolution photos on the device in question and therefore the actual capture resolution depends on the device. Capturing a photo or selecting a photo from the Pictures library or from the Photos media library by using a photo chooser button takes the user to a magnification page.
On the magnification page the captured or selected photo is displayed in a fit-to-screen fashion and touching the photo with a finger pops up a magnification loupe in the touch point area. The loupe magnifies the photo so that it is rendered pixel perfectly (one screen pixel equals to one photo pixel) and the user can inspect the details of the photo.
Magnification is always pixel-per-pixel, so the actual depth of zoom depends on the resolution of the photo: for higher resolution photos the zooming experience is deeper and for lower resolution photos the zooming experience is shallower. Also notice that if the photo is smaller than the actual screen resolution of the device, the loupe will actually show the image smaller than what it is in the fit-to-screen up-scaled view.
In addition to magnification and reframing there is also an information page that displays a selection of EXIF record values for the photo in question.
Here's a class diagram showing the overall structure of the application. Note that only the most relevant attributes, methods, and relations are depicted here.
Application data model:
PhotoModel contains methods for initializing the model with a new photo, a photo from the Pictures library as a stream, or a photo from a library token, as well as methods for saving photos. In the saving functionality, if the photo in question exceeds 5 megapixels in size, a down-scaled version of the photo is saved to Photos media library and the original higher resolution photo is saved to Camera Roll with "__highres" suffix in the file name. Photos named using this naming convention are not visible in Photos application. If the photo is smaller than 5 megapixels it is saved only to the Photos media library as there is no sense in double saving it unnecessarily. Later when a photo is opened using the PhotoChooserTask the application attempts to match the lower resolution media library photo with a locally saved higher resolution original. For re-framed photos double saving is executed in a similar manner in order to allow the user to re-frame them again.
PhotoModel also contains methods to tombstoning and untombstoning the model, as well as cleaning up the high resolution photos from Camera Roll when the low resolution counterpart has been deleted from the Photos media library. Cleanup routine is executed always when the application is launched or activated.
See Working with high resolution photos article to learn how to use PhotoCaptureDevice API to capture high resolution photos, process the captured frames with Nokia Imaging SDK, and handle high and low resolution copies of a photo.
|Photo Inspector project||v2.0||photo-inspector-v2.0.zip|
|Photo Inspector application binary file||v2.0||PhotoInspector_v2_0.xap|
This example application is hosted in GitHub, where you can check the latest activities, report issues, browse source, ask questions or even contribute yourself to the project.
Last updated 23 June 2014
We appreciate your feedback.