How can I skip compressing one PNG?
(Note: I have solved this problem, but it took long enough that I’m posting question/answer here.)
The Xcode build process “optimizes” my PNGs when building. This isn’t usually a problem, but iTunesArtwork being processed in this way causes corrupts it so that iTunes not to be able to show it. How can I prevent this?
4 Solutions Collect From Internet About “How can I skip compressing one PNG?”
You can read more about Xcode’s PNG compression here:
While you can turn off PNG optimization/compression entirely using “Compress PNG Files” in your project settings (it’s visible only if the project’s Base SDK is set to a device SDK, not a simulator SDK), you don’t want to do this! Read the link above for details on why, but the gist of it is that the optimization lets the iPhone skip some math that slows down PNG display.
Xcode will only optimize PNG image files that it knows about. To prevent a specific PNG from being optimized, you change its file type so Xcode no longer knows it’s a PNG.
- Select the file in the project window.
- Choose File->Get Info.
- On the General tab, change File Type from
(This is actually the default when you add a file without an extension, which is presumably why iTunesArtwork doesn’t have one. But if you’re pedantic like me you checked the File Type setting and fixed it.)
Found another very simple method to disable compression for a single png file. I think this is a better approach than the accepted answer because you don’t have to change type (or extension) of file in the local file-system but only in XCode.
Change the file type from
Default - PNG Image to
Data in Identity and Type inspector in XCode. See below:
For all you guys using Xcode 6.4 and above:
Go to: “Targets” – “YourProject Name”.
Next go to the “Build Settings” tab. Just below the Tab name click the “Basic” and “Combined” Button.
Next scroll down to the “Packaging” seperator and you will find “Compress PNG Files” set to “Yes” by default.
1.Goto your build setting 2.Search flag Compress PNG files and set it to NO.(default is YES).
After this compression of PNG images will be avoided.
Just For more info
- Xcode: Is there a way to change line spacing (UI Label) in interface builder?
- How to install 2 versions of the same application on iOS?
- “Application windows are expected to have a root view controller at the end of application launch” error only on iPad
- How do I animate constraint changes?
- How do I reliably get Instruments 4.x to symbolicate?
- Voip(Voice over IP) missing in Xcode 9
- @class May I know the proper use of this
- “interfaceOrientation” is deprecated in iOS 8, How to change this method Objective C
- UIView outside of a View Controller in a Storyboard
- why should we add () when we create a empty array
- Exception:Google Maps SDK for iOS must be initialized via prior to use
- iOS button title color won't change
- performance for reads of nsdictionary vs nsarray
- Converting hex string to hex data
- How do I determine the size of the editing control in a UITableViewCell delete style?