Page 1 of 2

iPhone Flavor of PNG format

Posted: Sat Aug 21, 2010 10:59 am
by maadjordan
Dear Pierre,

I've come into an iphone app which is just a plain zip file. I've extracted the content tried to view images with no success then i found this link (http://www.modmyi.com/wiki/index.php/Iphone_PNG_images) which shows that Apple as altered PNG format. The link also propose a way to decode and some tools but i prefer XnView as always :mrgreen:

Re: Iphone Flavor of PNG format

Posted: Sun Aug 22, 2010 1:09 pm
by xnview
Could you send me some samples?

Re: Iphone Flavor of PNG format

Posted: Sun Aug 22, 2010 11:41 pm
by obelisk
we really shouldn't support people who break formats.

Re: Iphone Flavor of PNG format

Posted: Mon Aug 23, 2010 6:45 am
by MaxSt
Yeah, lets implement normal PNG completely (some features are still missing), before supporting this abomination.

Re: Iphone Flavor of PNG format

Posted: Mon Aug 23, 2010 7:48 am
by xnview
which features?

Re: iPhone Flavor of PNG format

Posted: Mon Aug 23, 2010 12:56 pm
by MaxSt
1. Colormode 4 = "greyscale with alpha"

2. Some APNG examples: http://animatedpng.com/index.php/news/f ... g-samples/

Re: Iphone Flavor of PNG format

Posted: Tue Aug 24, 2010 6:05 am
by DOS386
obelisk wrote:we really shouldn't support people who break formats.
Right. If they want a new format, they should:

1. Make sure that it's sufficiently superior to existing formats, otherwise there is no point to invent it (similar applies to other "new" stuff like video codecs)

2. Give it a new name sufficiently different from existing format names

So, don't suport this at all, or support it, but only after some "enable broken formats" hack has been activated and a thick warning thrown. XNVIEW should NOT pretend such "PNG"'s would be fine (and other viewers broken).

PNG is a well specifed format and should remain that way.
2. Some APNG examples:
APNG is NOT PNG. APNG has been rejected by the PNG developers, as it also breaks the PNG spec (maybe slightly less aggresively than this iphone hack ???).
Colormode 4 = "greyscale with alpha"
Examples please :-)

Re: iPhone Flavor of PNG format

Posted: Tue Aug 24, 2010 2:51 pm
by JohnFredC
XnView (and all other image viewers) should be format-neutral to the extent it is reasonable/possible. Image viewers, after all, serve the user purpose of viewing image files, NOT some vague philosophical industry (or special interest) goal of suppressing the proliferation of obscure image formats (no matter how desirable it may be for the industry at large - and the user population in particular - to attempt that).

Any image viewer that refuses to read a format for such reasons acts to "cut off its own nose to spite its own face". The users will simply look elsewhere.

The iPhone is enormously popular. Silly not to support image formats that it supports, bastardized or not.

Just my 2 pfennigs.

Re: iPhone Flavor of PNG format

Posted: Tue Aug 24, 2010 4:04 pm
by Clo
:arrow: JohnFredC

:) Hello John !
…Any image viewer that refuses to read a format for such reasons acts to "cut off its own nose to spite its own face". The users will simply look elsewhere. …
• I agree. Prior, XnView must perform the jobs it's designed for,
then feel free to yell at the formats breakers as much as you want ! :P

:mrgreen: KR
Claude
Clo

Re: iPhone Flavor of PNG format

Posted: Tue Aug 24, 2010 6:46 pm
by helmut
JohnFredC wrote:...
The iPhone is enormously popular. Silly not to support image formats that it supports, bastardized or not.
+1
(Given that performance of PNG reading is not affected, Apple "PNG" format should also be supported).
JohnFredC wrote:Just my 2 pfennigs.
In Germany, we have euros and cents, now. ;-)

Re: iPhone Flavor of PNG format

Posted: Wed Aug 25, 2010 5:46 am
by MaxSt
JohnFredC wrote:The iPhone is enormously popular. Silly not to support image formats that it supports, bastardized or not.
Let's support regular PNG fully first.

Re: Iphone Flavor of PNG format

Posted: Wed Aug 25, 2010 6:08 am
by MaxSt
DOS386 wrote:APNG is NOT PNG. It also breaks the PNG spec
No it's not. PNG specs allows third-party chunks extensions. If a third-party follows those chunk-naming rules, you cannot accuse them of breaking anything.
DOS386 wrote:APNG has been rejected by the PNG developers
Not unanimously. Some PNG developers love it.

Your outrage is misplaced anyway, as XnView is the only image viewer that supports APNG. It's a big selling point against competitors.
DOS386 wrote:Examples please :-)
http://newsgroup.xnview.com/viewtopic.p ... 74&start=0

Re: iPhone Flavor of PNG format

Posted: Thu Aug 26, 2010 2:00 am
by XnTriq
MaxSt wrote:Yeah, lets implement normal PNG completely (some features are still missing), before supporting this abomination.
I fully support your request for full support ;-)

According to what I've been reading on the interwebs, ...
Borko Furht ([url=http://books.google.com/books?id=Ipk5x-c_xNIC&lpg=PR1&ots=ovOkuhRiXL&dq=%22Encyclopedia%20of%20Multimedia%22&pg=PR1#v=onepage&q&f=false]Encyclopedia of Multimedia[/url] » Page 729) wrote:Chunk types can come from three main sources: the PNG standard, registered public chunk types maintained by the PNG Development Group, and private chunks, defined by some applications. This chunk-based structure is designed to allow the PNG format to be extended while maintaining compatibility with older versions.
... ancillary custom chunks (as used for Math PNG, Worms, ZDoom etc.) come in two flavors:
  1. Public chunks (= registered = standardized)
  2. Private chunks (= unregistered = non-standardized)
Jonathan Branam (Dr.Dobb's: [url=http://www.drdobbs.com/mobility/224400563?pgno=2]Developing for the iPad[/url] » Save Fast and Save Often) wrote:The concept of continuous, incremental saving is crucial to the operation of every iPhone OS application. Users on the phone may be interrupted at any time to receive a call and may decide to exit your application at any time. Apple frowns on applications that offer an explicit Save or Load button, instead encouraging developers to save while the user works. For Ideate, I designed a custom file format based on the PNG image file format. The PNG format supports custom chunks in the file which can contain any data that an application required. Adobe Fireworks uses this approach to store all of its metadata in a PNG file and I thought it was a good idea. This means that browsers, image editors, and mail clients can all render an Ideate image, but only the Ideate app itself will load and save the custom chunks of data inside the file.
XnTriq ([url=http://newsgroup.xnview.com/viewtopic.php?p=65771#p65771]Common graphic formats[/url]) wrote:
libpng.org ([url=http://www.libpng.org/pub/png/pngintro.html]A Basic Introduction to PNG Features[/url]) wrote:Like GIF and TIFF, PNG is a raster format, which is to say, it represents an image as a two-dimensional array of colored dots (pixels). PNG is explicitly not a vector format, i.e., one that can store shapes (lines, boxes, ellipses, etc.) and be scaled arbitrarily without any loss of quality (generally speaking). For that you probably want SVG or PostScript. (There are some private extensions to PNG that add vector information in addition to PNG's regular pixels — Macromedia's Fireworks does something along those lines — but no valid PNG may omit the pixel data.)
Private chunks” in Fireworks PNG files: prVW, mkBF, mkBS, mkBT, mkTS.
Wikipedia (Portable Network Graphics » [url=http://en.wikipedia.org/wiki/Portable_Network_Graphics#Software_support]Software support[/url]) wrote:Adobe Fireworks (formerly by Macromedia) uses PNG as its native file format, allowing other image editors and preview utilities to view the flattened image. However, Fireworks by default also stores meta data for layers, animation, vector data, text and effects. Such files should not be distributed directly. Fireworks can instead export the image as an optimized PNG without the extra meta data for use on web pages, etc.

Re: Iphone Flavor of PNG format

Posted: Thu Aug 26, 2010 8:39 am
by DOS386
MaxSt wrote:
DOS386 wrote:APNG is NOT PNG. It also breaks the PNG spec
No it's not. PNG specs allows third-party chunks extensions. If a third-party follows those chunk-naming rules, you cannot accuse them of breaking anything.
They tried to do it "legally and smoothly" but still APNG breaks the purpose of PNG "to store a single static image".
DOS386 wrote:APNG has been rejected by the PNG developers
Not unanimously. Some PNG developers love it.
Right, but the majority said NO.
Your outrage is misplaced anyway, as XnView is the only image viewer that supports APNG. It's a big selling point against competitors.
There is no "outrage". I didn't ask for removing APNG support. Just pointing that it's a controversial enhancement, and PNG support can be complete without APNG support. BTW, the APNG frame decomposition is still broken in NC/XN.
Good :-)

> The iPhone is enormously popular. Silly not to support image
> formats that it supports, bastardized or not.

Ask apple to fix his iPhone ?

> (Given that performance of PNG reading is not affected,
> Apple "PNG" format should also be supported).

It doesn't affect the performance, just ruins a clean standard. One day people might consider the Apple "PNG" as "standard" and the original PNG as "broken". Again, I suggest adding a <enable support for broken Apple "PNG" files> option (off by default) and a warning into the history: <added support for broken Apple "PNG" files, must be enabled before using, note that those files are NOT valid PNG>.

Re: Iphone Flavor of PNG format

Posted: Thu Aug 26, 2010 6:15 pm
by MaxSt
DOS386 wrote:They tried to do it "legally and smoothly" but still APNG breaks the purpose of PNG "to store a single static image".
It could be their wish, but they forgot to make specific rules about what kind of information is forbidden in third-party chunks. Without such rules, I could embed mp3 inside, if I want to. With album artwork inside that mp3. Oh wait, that's another image... but who cares, really?

They accepted sTER chunk, by the way (stereo pair: one for left eye, one for right eye).
DOS386 wrote:Right, but the majority said NO.
Right, but if it's clearly broken, it would be unanimous no.
It's all irrelevant anyway, because their votes will not stop people from using APNG.