• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CopyPNGFile apparently garbles PNGs in iPhone build
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CopyPNGFile apparently garbles PNGs in iPhone build


  • Subject: Re: CopyPNGFile apparently garbles PNGs in iPhone build
  • From: Greg Guerin <email@hidden>
  • Date: Tue, 11 Aug 2009 22:31:07 -0700

Fritz Anderson wrote:

$ ls -l@ myIcon.png
-rw-r--r--@ 1 fritza  fritza  8019 Aug 11 20:16 myIcon.png
	com.apple.FinderInfo	  32
	com.apple.ResourceFork	58825

$ file myIcon.png
xAPXi.png: PNG image data, 57 x 57, 8-bit/color RGB, non-interlaced

Photoshop left a big resource fork, but the icon is readable (and displays as intended in Preview). When I build for the Simulator, the icon shows up as expected.

== In the .app directory, built for Device/Debug:

$ ls -l@ myIcon.png
-rw-r--r--  1 fritza  fritza  8953 Aug 11 20:20 myIcon.png

$ file myIcon.png
APXi.png: PNG image data, 805314566 x 396263525, 0-bit grayscale,

Good thing that's 0-bits per pixel, or it would take a LOT of disk space (3.19e17 pixels).


Some things to try...

Strip the resource-fork and any other non-Finder xattrs before CopyPNGFile runs (the xattr cmd should be able to delete the xattrs). Do this with a test file, to see if it makes any difference. If not, then go back to the original file.

Use the 'sips' command to see what properties it can extract from the Before and After files (i.e. before and after the damage is done). ('sips' is the command behind Automator's image-processing actions. I've used it quite a bit in shell scripts, and am generally happy with how it works. YMMV.)

Use 'sips' to resample the original PNG to the same height and width as the original, also writing to PNG, then see if CopyPNGFile damages or maintains the resulting file. I'm wondering if Photoshop might be writing a PNG format that CopyPNGFile is unable to understand, but is also unable to realize it doesn't understand.

Use 'sips' to create the icon in the resource-fork, instead of relying on Photoshop.

In Photoshop, change one or more of the parameters that might affect the written data, such as compression (e.g. try uncompressed, since CopyPNGFile is apparently doing compression of its own), or maybe BGR instead of RGB, or ARGB instead of RGB (even with an opaque alpha).

In Photoshop, write to TIFF, then use 'sips' to convert to PNG before the CopyPNGFile build phase occurs. (This assumes the sips-resampled png files from the earlier test aren't damaged by CopyPNGFile.)

  -- GG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: CopyPNGFile apparently garbles PNGs in iPhone build
  • Next by Date: Re: CopyPNGFile apparently garbles PNGs in iPhone build
  • Previous by thread: Re: CopyPNGFile apparently garbles PNGs in iPhone build
  • Next by thread: Coaxing pbxcp into Preserving Symbolic Links
  • Index(es):
    • Date
    • Thread