Skip to content

Commit

Permalink
Example of an image that goes wrong due to propably bits/colour or so…
Browse files Browse the repository at this point in the history
…mething.
  • Loading branch information
dirkx committed Mar 28, 2012
1 parent e547027 commit 0e4c408
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions XBImageFilters.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
3295F23D1522FD3100C27406 /* basn6a16.png in Resources */ = {isa = PBXBuildFile; fileRef = 3295F22E1522FD3100C27406 /* basn6a16.png */; };
3295F2401522FE4D00C27406 /* UIImage+XBImageFilters.m in Sources */ = {isa = PBXBuildFile; fileRef = 3295F23F1522FE4D00C27406 /* UIImage+XBImageFilters.m */; };
3295F2421522FFDB00C27406 /* marvin.png in Resources */ = {isa = PBXBuildFile; fileRef = 3295F2411522FFDB00C27406 /* marvin.png */; };
3295F27E1523116700C27406 /* russian-ball.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 3295F27D1523116700C27406 /* russian-ball.jpeg */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -119,6 +120,7 @@
3295F23E1522FE4D00C27406 /* UIImage+XBImageFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+XBImageFilters.h"; sourceTree = "<group>"; };
3295F23F1522FE4D00C27406 /* UIImage+XBImageFilters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+XBImageFilters.m"; sourceTree = "<group>"; };
3295F2411522FFDB00C27406 /* marvin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = marvin.png; sourceTree = "<group>"; };
3295F27D1523116700C27406 /* russian-ball.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "russian-ball.jpeg"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -280,6 +282,7 @@
3295F2431523006F00C27406 /* png test set */ = {
isa = PBXGroup;
children = (
3295F27D1523116700C27406 /* russian-ball.jpeg */,
3295F2411522FFDB00C27406 /* marvin.png */,
3295F2201522FD3100C27406 /* basn0g01.png */,
3295F2211522FD3100C27406 /* basn0g02.png */,
Expand Down Expand Up @@ -375,6 +378,7 @@
3295F23C1522FD3100C27406 /* basn6a08.png in Resources */,
3295F23D1522FD3100C27406 /* basn6a16.png in Resources */,
3295F2421522FFDB00C27406 /* marvin.png in Resources */,
3295F27E1523116700C27406 /* russian-ball.jpeg in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
7 changes: 6 additions & 1 deletion XBImageFilters/Classes/Sample/ProcessingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ - (void)viewDidLoad
@"basn4a16.png",@"16 bit grayscale + 16 bit alpha",
@"basn6a08.png",@"3x8 bits rgb color + 8 bit alpha",
@"basn6a16.png",@"3x16 bits rgb color + 16 bit alpha",
@"russian-ball.jpeg",@"Russion ball",
nil];
labels = [[images allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
return [obj1 compare:obj2];
Expand Down Expand Up @@ -106,7 +107,11 @@ - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComp
imageView.image = [img imageByApplyingShaders:shaders];
#else
UIImage * newImg = [img imageByApplyingShaders:shaders];
NSData * data = UIImagePNGRepresentation(newImg);
// We're using UIImageJPEGRepresentation rather than UIImagePNGRepresentation here
// as the latter will not honour our orientation. (radar bug #11137002. JPEG
// does though.
//
NSData * data = UIImageJPEGRepresentation(newImg,1.0);
imageView.image = [UIImage imageWithData:data];
#endif

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0e4c408

Please sign in to comment.