Re: EXIF support in PNG
Glenn Randers-Pehrson <[email protected]>
| Newsgroups | gmane.comp.graphics.png.general |
|---|---|
| Message-ID | <CA+PdXcsZ04Qo1RN2u6Z69nKLqh8SyJoq_0+v0mawS=r53yY0JQ@mail.gmail.com> |
Very recently I saw a bug report about ImageMagick; someone writing a PNG with GIMP mixed up resolution units and put 11000 pixels per cm, resulting in IM running out of memory trying to expand the image. I'm not suggesting that that's a bug that we need to fix, but it is s security issue to be aware of. Sorry, I can't find that bug report now... Glenn Glenn On Thu, Jan 12, 2017 at 10:51 PM, John Bowler < [email protected]> wrote: > This github project: > > https://github.com/jbowler/jpegtopng > > Now contains a Makefile and source to build three programs: > > jpegtopng: requires an installed -ljpeg and -lz > jpegdump: stand-alone hack program to dump a JPEG > pngdumpmeta: requires -lpng and -lexiv2 > The first file takes any JPEG with an APP1 EXIF marker and converts it > to an exIf chunk matching Willems previously supplied example image. > > The second is just a way of looking inside a JPEG, at least for the > markers it understands (it also produces lots of warnings with -Wall). > > The third is the real example program; it decodes the exIf chunk > (that's just a few lines of code, mostly recognizing that it is an > exIf from the header) then it prints the contents using the Exiv2 > library; that's about 20 lines of code as well. > > It also prints an ISO XMP chunk. Quite a lot of the code is to verify > UTF-8 data (that's in the directory hutf8/), XMP is just raw XML so it > just prints so long as it is valid. > > It will also print text chunks; either a list of the keywords or the > text one of them contains. It prints the text in UTF-8; so it > converts the Latin1 text in tEXt or zTXt chunks into UTF-8 on-the-fly. > > It only does one thing at once. The first and last programs read from > stdin and write to stdout (no file management). > > Next I'm going to look at adding support for the text chunk used to > output Exif from Image/GraphicsMagick and DigiKam. The sample code in > the pngexif directory already does that but I haven't tested it. It's > 132 lines of code as opposed to 59 when the data is in an unknown > chunk; decoding the format about doubles the amount of code required > (the rest of it is comments and looking though the text or unknown > chunk lists.) > > I haven't verified compilation against libpng12 yet, but I don't > anticipate any problems. > > John Bowler > > ------------------------------------------------------------ > ------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > _______________________________________________ > png-mng-misc mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/png-mng-misc > ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ png-mng-misc mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/png-mng-misc