Giter Site home page Giter Site logo

Comments (4)

LarsKoelpin avatar LarsKoelpin commented on May 28, 2024

acutally i noticed the pattern:
FF D8 FF E0

seems to be missing. Does yur image fall into this category?

from magic-bytes.

pastelmind avatar pastelmind commented on May 28, 2024

Nope, mine is FF D8 FF E2. It contains a proprietary segment E2, but image viewers seem to ignore this and display the image data.

The structure of JPG makes it difficult to generalize the fourth byte, since some programs add arbitrary segments. See https://stackoverflow.com/a/5413049

from magic-bytes.

pastelmind avatar pastelmind commented on May 28, 2024

Hey, thanks for adding 2ea4e40 in v1.8.0. But this addition would obsolete existing checks for JPEG, as they are now redundant:

add("jpg", ["0xFF", "0xD8", "0xFF", "0xDB"], {
mime: "image/jpeg",
extension: "jpeg",
});
add(
"jpg",
[
"0xFF",
"0xD8",
"0xFF",
"0xE0",
"?",
"?",
"0x4A",
"0x46",
"0x49",
"0x46",
"0x00",
"0x01",
],
{ mime: "image/jpeg", extension: "jpeg" }
);
add(
"jpg",
[
"0xFF",
"0xD8",
"0xFF",
"0xE1",
"?",
"?",
"0x45",
"0x78",
"0x69",
"0x66",
"0x00",
"0x00",
],
{ mime: "image/jpeg", extension: "jpeg" }
);

I expected you to remove them altogether, but you left them in. Are these still necessary? If not, I'll submit a PR to delete them.

from magic-bytes.

LarsKoelpin avatar LarsKoelpin commented on May 28, 2024

You are right. Your PR is merged. Thanks

from magic-bytes.

Related Issues (19)

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.