View Single Post
  #4  
Old February 13th 20, 12:03 PM posted to alt.windows7.general,alt.comp.os.windows-10,microsoft.public.windowsxp.general
Paul[_32_]
external usenet poster
 
Posts: 11,873
Default Does the .png image format have a text metadata field?

J. P. Gilliver (John) wrote:
For .jpg image files, I can add text notes to them very easily: in
IrfanView, I just (open the image and then) type I (info) then C (comment).

This doesn't work for the .png file format.

_Does_ the .png format _have_ a metadata text field? If so, what utility
lets you see it, and ideally edit it?

(I'm talking about text that _becomes part of the file_, not that is
attached to it in some "album" type management system: such that it
remains part of the file even if the file is renamed, moved, or even
emailed.)


It has multiple flavors of metadata, according to this.

https://stackoverflow.com/questions/...-data-like-jpg

The original specification has two kinds of text chunks,
a plaintext and a compressed text thing. And also has some other
things which contain specific kinds of information.

https://en.wikipedia.org/wiki/Portable_Network_Graphics

"ancillary chunks"

The above (temporally long) StackOverflow claims in 2017, an
actual EXIF chunk was added. The benefit of this, is
no "custom" handler would be needed to attempt to parse
key-value pairs from one of the older chunk types. Since this
is optional, no program absolutely has to add it, and the
usual 4CC parse logic applies (a field you don't understand,
ignore it).

http://ftp-osl.osuosl.org/pub/libpng....0.html#C.eXIf

[4CC code of "eXIf" case sensitive]

As of today then, you can add it.

It's just a matter of "tools" to do it.

Note that the idea of compressing text means that you
can't just necessarily dump the old chunk style into
a hex editor and "recognize" the text by eye. Only the
weakest kinds of compression (like LZ4) allow doing that.

Whereas, at a guess, if an EXIF chunk was added, I would
expect the EXIF chunk to be similar to other image formats,
and concentrate more on usability than efficiency. If we
could find an example of a 2017+ PNG with added EXIF, then
we could check for that.

But otherwise, PNG has a lot of emphasis on efficiency.
That's why one PNG program, it attempts to compress a
PNG like 20 times (with different settings), it compares
all the compressed sizes, then "picks" the smallest file
out of the lot. PNG has multiple bit-depth settings,
which allow cartoon-like materials to be heavily compressed.

For some reason, the program for doing that can't seem to
just pick the best options from an analysis of the format,
and relies on brute force compression followed by
selection, to pick the format. People use such programs
for web site preparation and crushing the byte count
for best efficiency. Like it matters when the .js fleet
is 5MB :-( "The part that pays the bills", they don't
care how big that part gets. Whereas the PNG file must
be crushed flat.

So if you were expecting to see a lot of metadata in
web page PNGs, I would guess it wouldn't be that common.
It would take a JPG camera picture, a workflow with
2017 extension support, followed by presentation of
the item by an amateur somewhere.

In a quick search, the PNGs in my current download folder,
none of those seemed to have anything resembling an EXIF.
But that doesn't mean anything. Whereas if I were to
start throwing downloaded JPG images into HxD, I would
likely be seeing some text up near the front (an occasional
JPG would still have the camera data).

Summary: Yes, you can add metadata.
Problem one, is adding the new chunk type.
Problem two, is a recipient being able to view the
new added chunk.
Problem three, is downloading a recent enough tool,
so that JPG to PNG conversion, conserves the EXIF part,
so you won't be doing this by hand.

I doubt I have anything like that here, since I would never
have expected an image format to evolve, and then me
needing to upgrade tools for that specific purpose.
Imagemagick is probably the tool I would be most likely
to sample a new version. GIMP, the "playing with the interface
crap", has driven me away from trying new versions. While I have
Irfanview on a number of OS installs here, I don't spend a lot
of time in that program to know when support for that would
be added.

For these newsgroups then, the question would be whether
the federated search has a handler for EXIF in PNG and
indexes it, or has an option to display an EXIF chunk if you
manage to add one. I presume you want integration so
the OS does something useful too.

If the 2017 date is correct, I wouldn't expect miracles. Even
Windows 10 might be missing support.

Paul
Ads