Giter Club home page Giter Club logo

Comments (1)

00dani avatar 00dani commented on June 7, 2024 1

I did some quick experimentation. Exifr can successfully parse very long text fields from PNGs, but only if the text been encoded into the PNG file as tEXt chunks. There are three kinds of text chunks the PNG specification allows - tEXt, zTXt, and iTXt - and Exifr currently only has code to process the first of these. The other two are simply ignored.

tEXt is the simplest: it's just plain text, stored in the Latin-1 encoding. It's the easiest for Exifr to process as a result.

zTXt is semantically the same as tEXt, except that the text data is stored compressed, so it's recommended for longer strings. Depending on the software you're using to make your PNGs, it might decide to use a zTXt chunk rather than a tEXt chunk when the field's length hits 1000 characters, but there's no hard requirement that this happen. For example, ExifTool produces a tEXt chunk unless it's explicitly asked to use compression.

Finally, iTXt refers to international text - the text is stored in UTF-8 encoding, and may optionally be compressed as well. ExifTool and most likely other PNG processing software will automatically switch to this encoding if the text to be stored contains any characters outside of the Latin-1 range.

The main problem with Exifr supporting these extra chunk types is that both of them use compression. Currently Exifr can handle a few compressed fields, but only when it's running in Node, not in the browser, because Node's standard library provides zlib bindings and browsers do not. Requiring an alternative deflate implementation to read compressed metadata in-browser, such as fflate, would be entirely doable however.

from exifr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.