Git Product home page Git Product logo

Comments (4)

rubenv avatar rubenv commented on June 26, 2024

In some very distant past, I used to write the metadata parsing code of taglib-sharp.

I ran the image above through the debug utilities from that one which yielded the following:

Tags in object  : TiffIFD, XMP

Comment         : 
Keywords        : 2007-09-10 Extreme Blue Expo + London Extreme Blue 
Rating          : 
DateTime        : 9/12/2007 4:12:32 PM
Orientation     : TopLeft
Software        : 
ExposureTime    : 0.00625
FNumber         : 10
ISOSpeedRatings : 800
FocalLength     : 48
FocalLength35mm : 
Make            : Canon
Model           : Canon EOS 350D DIGITAL
Width           : 3091
Height          : 2057
Type            : JFIF File

Writable?       : False
Corrupt?        : True
    * Impossibly large item count
    * Invalid IFD offset

So this file has known quirks. I'll have a look at how they're detect and how we can work around them in goexif2.

Also interesting: we have a little tool that strips image data from files. This allows you to make super-tiny JPEG files for unit tests. Over here: https://github.com/mono/taglib-sharp/blob/master/examples/StripImageData.cs

from goexif2.

rubenv avatar rubenv commented on June 26, 2024

First one:

            if (count > 0x10000000) {
                // Some Nikon files are known to exhibit this corruption (or "feature").
                file.MarkAsCorrupt ("Impossibly large item count");
                return null;
            }

Happens while parsing the IFD.


Second one:

            if (base_offset + offset > length) {
                file.MarkAsCorrupt ("Invalid IFD offset");
                return 0;
            }

So there might be a pointer pointing outside of the image file.

from goexif2.

rubenv avatar rubenv commented on June 26, 2024

PR submitted (#13), turned out to be an IFD offset pointing outside of the file (int32(1852796448)).

from goexif2.

xor-gate avatar xor-gate commented on June 26, 2024

Thank you for your contribution. For easy vendoring I have released v1.1.0

from goexif2.

Related Issues (7)

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.