Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version 2.5.6

  • Loading branch information...
commit ba7286a087d8ca433a97a57750274c458c0bd484 1 parent 01645e9
Julius Oklamcak authored April 17, 2012
12  README
@@ -51,7 +51,7 @@ NOTES
51 51
 
52 52
 Version 2.x of the PDF reader/viewer code was originally developed
53 53
 and tested under Xcode 3.2.6, LLVM 1.7, iOS 4.3.5, iOS 4.2.1 with
54  
-current development and testing under Xcode 4.3, Clang 3.1, iOS 5.
  54
+current development and testing under Xcode 4.3.2, LLVM 3.1, iOS 5.
55 55
 The code uses manual memory management and will continue to do so.
56 56
 
57 57
 The overall PDF reader/viewer functionality is encapsulated in the
@@ -145,6 +145,11 @@ READER_STANDALONE - If FALSE, a "Done" button is added to the toolbar
145 145
 and the -dismissReaderViewController: delegate method is messaged when
146 146
 it is tapped.
147 147
 
  148
+READER_DISABLE_RETINA - If TRUE, sets the CATiledLayer contentScale
  149
+to 1.0f. This effectively disables retina support and results in
  150
+non-retina device rendering speeds on retina display devices at
  151
+the loss of retina display quality.
  152
+
148 153
 ReaderDocument Archiving
149 154
 ------------------------
150 155
 
@@ -224,6 +229,11 @@ HISTORY
224 229
 	- Bug fix to PDF link handling with cropboxed PDF files.
225 230
 	- Some performance improvements on iPad 3rd generation.
226 231
 
  232
+2012-04-16: Version 2.5.6
  233
+
  234
+	- Now loads and decodes thumbnail PNGs on a background thread.
  235
+	- Added READER_DISABLE_RETINA #define performance option.
  236
+
227 237
 CONTACT INFO
228 238
 ============
229 239
 
4  Reader-Info.plist
@@ -26,9 +26,9 @@
26 26
 	<key>CFBundleSignature</key>
27 27
 	<string>????</string>
28 28
 	<key>CFBundleVersion</key>
29  
-	<string>2.5.5</string>
  29
+	<string>2.5.6</string>
30 30
 	<key>CFBundleShortVersionString</key>
31  
-	<string>2.5.5</string>
  31
+	<string>2.5.6</string>
32 32
 	<key>LSRequiresIPhoneOS</key>
33 33
 	<true/>
34 34
 	<key>UIPrerenderedIcon</key>
BIN  Resources/Reader.pdf
Binary file not shown
3  Sources/ReaderConstants.h
... ...
@@ -1,6 +1,6 @@
1 1
 //
2 2
 //	ReaderConstants.h
3  
-//	Reader v2.5.4
  3
+//	Reader v2.5.6
4 4
 //
5 5
 //	Created by Julius Oklamcak on 2011-07-01.
6 6
 //	Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -29,6 +29,7 @@
29 29
 #define READER_ENABLE_MAIL TRUE
30 30
 #define READER_ENABLE_PRINT TRUE
31 31
 #define READER_ENABLE_THUMBS TRUE
  32
+#define READER_DISABLE_RETINA FALSE
32 33
 #define READER_DISABLE_IDLE FALSE
33 34
 #define READER_SHOW_SHADOWS TRUE
34 35
 #define READER_STANDALONE FALSE
16  Sources/ReaderContentPage.m
... ...
@@ -1,6 +1,6 @@
1 1
 //
2 2
 //	ReaderContentPage.m
3  
-//	Reader v2.5.5
  3
+//	Reader v2.5.6
4 4
 //
5 5
 //	Created by Julius Oklamcak on 2011-07-01.
6 6
 //	Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -23,6 +23,7 @@
23 23
 //	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 24
 //
25 25
 
  26
+#import "ReaderConstants.h"
26 27
 #import "ReaderContentPage.h"
27 28
 #import "ReaderContentTile.h"
28 29
 #import "CGPDFDocument.h"
@@ -552,6 +553,19 @@ - (void)dealloc
552 553
 	[super dealloc];
553 554
 }
554 555
 
  556
+#if (READER_DISABLE_RETINA == TRUE) // Option
  557
+
  558
+- (void)didMoveToWindow
  559
+{
  560
+#ifdef DEBUGX
  561
+	NSLog(@"%s", __FUNCTION__);
  562
+#endif
  563
+
  564
+	self.contentScaleFactor = 1.0f; // Override scale factor
  565
+}
  566
+
  567
+#endif // end of READER_DISABLE_RETINA Option
  568
+
555 569
 /*
556 570
 - (void)layoutSubviews
557 571
 {
14  Sources/ReaderThumbFetch.m
... ...
@@ -1,6 +1,6 @@
1 1
 //
2 2
 //	ReaderThumbFetch.m
3  
-//	Reader v2.5.4
  3
+//	Reader v2.5.6
4 4
 //
5 5
 //	Created by Julius Oklamcak on 2011-09-01.
6 6
 //	Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -134,7 +134,15 @@ - (void)main
134 134
 
135 135
 		CGImageRelease(imageRef); // Release the CGImage reference from the above thumb load code
136 136
 
137  
-		[[ReaderThumbCache sharedInstance] setObject:image forKey:request.cacheKey]; // Update cache
  137
+		UIGraphicsBeginImageContextWithOptions(image.size, YES, request.scale); // Graphics context
  138
+
  139
+		[image drawAtPoint:CGPointZero]; // Decode and draw the image on this background thread
  140
+
  141
+		UIImage *decoded = UIGraphicsGetImageFromCurrentImageContext(); // Newly decoded image
  142
+
  143
+		UIGraphicsEndImageContext(); // Cleanup after the bitmap-based graphics drawing context
  144
+
  145
+		[[ReaderThumbCache sharedInstance] setObject:decoded forKey:request.cacheKey]; // Update cache
138 146
 
139 147
 		if (self.isCancelled == NO) // Show the image in the target thumb view on the main thread
140 148
 		{
@@ -144,7 +152,7 @@ - (void)main
144 152
 
145 153
 			dispatch_async(dispatch_get_main_queue(), // Queue image show on main thread
146 154
 			^{
147  
-				if (thumbView.targetTag == targetTag) [thumbView showImage:image];
  155
+				if (thumbView.targetTag == targetTag) [thumbView showImage:decoded];
148 156
 			});
149 157
 		}
150 158
 	}

0 notes on commit ba7286a

Please sign in to comment.
Something went wrong with that request. Please try again.