GithubHelp home page GithubHelp logo

Injection error about pyc2pa HOT 3 CLOSED

numbersprotocol avatar numbersprotocol commented on June 19, 2024
Injection error

from pyc2pa.

Comments (3)

bafu avatar bafu commented on June 19, 2024

Root Cause

CAI module treats non-CAI data as CAI metadata and tries to parse it.

Analysis

Currently, the CAI module finds the CAI metadata (APP11 Marker Segments if more precisely) only by searching the 0xFFEB which represents the APP11 Marker.

Screenshot from 2021-05-14 17-42-42

Under this condition, any data identical to 0xFFEB will be treated as the beginning of a CAI metadata.

Solution

Method 1: Workaround (I will go in this way because of resource constraint)

Checking both the App11 Marker and the CI parameter can be a quick workaround. It's a workaround because it only reduces the probability to treat non-CAI data as CAI metadata.

Screenshot from 2021-05-14 17-44-36

Method 2: Root cause solution

To my best knowledge, to fix this issue completely, we need to find all the starting points of the Marker Segments between SOI and DQT and only parse the APP11 Marker Segments.

Screenshot from 2021-05-14 17-49-15

from pyc2pa.

bafu avatar bafu commented on June 19, 2024

Testing image information

$ file scott.jpg 
scott.jpg: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=12, height=3024, manufacturer=samsung, model=SM-N9810, orientation=upper-right, xresolution=210, yresolution=218, resolutionunit=2, software=N9810ZSU1ATI4, datetime=2020:10:24 15:03:33, width=4032], baseline, precision 8, 4032x3024, components 3

from pyc2pa.

bafu avatar bafu commented on June 19, 2024

The workaround seems to work (although with known issue #15)

  • Raw photo
    • scott
  • Thumbnail (100x100)
    • scott-thumbnail
  • Multi-injection photo
    • scott-cai-cai-cai
$ sha256sum scott*
47e148074e9a3f658119c82e1a2e5aebb148a2a3864f6a1e4d1f58a4bd31a0ee  scott-cai-cai-cai.jpg
55146f1665fa84fe2a76d13772f7f83ea02a188cde68a047cb9acd2e28005d90  scott.jpg
bfd0c280dfa195a0e8468a0f0d1d6beecb652a70cf591c19187d0c5166cef6a8  scott-thumbnail.jpg

from pyc2pa.

Related Issues (17)

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.