Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help for jpeg #409

Open
DRCRecoveryData opened this issue Sep 20, 2021 · 8 comments
Open

Need help for jpeg #409

DRCRecoveryData opened this issue Sep 20, 2021 · 8 comments

Comments

@DRCRecoveryData
Copy link

Hi,
I repaired some jpeg encrypted jpeg by ransomware ( encrypted 150kb of header ) but when i move the good header to corrupt jpeg, how can i fix the color of this jpeg:
DSC_0019

@kornelski
Copy link
Member

kornelski commented Sep 20, 2021

I don't think it's a matter of a header. You may be missing a half of a line at the start of the file. Specifically, initial value of DC of luma channel is too high.

@DRCRecoveryData
Copy link
Author

DRCRecoveryData commented Sep 20, 2021

I don't think it's a matter of a header. You may be missing a half of a line at the start of the file. Specifically, initial value of DC of luma channel is too high.

Do you have any idea to fix these image issue? i'm making the batch header jpeg repair tool but don't know how to fix the DCT, yeah is missing some bytes after SOS so image corrupt the color

@kornelski
Copy link
Member

I don't think there's automated way to do it. It's a case of missing data, so it won't be easy to automate.

You will need to inject compressed data that starts the missing line correctly (adds darker blocks first).

@DRCRecoveryData
Copy link
Author

I don't think there's automated way to do it. It's a case of missing data, so it won't be easy to automate.

You will need to inject compressed data that starts the missing line correctly (adds darker blocks first).

Does libjpeg have command to fix the color jpeg?

@kornelski
Copy link
Member

kornelski commented Sep 20, 2021

Nothing has. This is not a broken color. The image you have really does look like that. It looks like that, because the data about its real brightness has been lost.

It may be technically possible to figure out how much data is missing by looking at premature end of data (last line is cut off in half), and then guess what the original brightness was by looking at raw decoded unclipped luma data and trying to normalize it. However, this is way beyond scope of libjpeg or any existing decoder. It would require a dedicated JPEG data repair software. I don't know if such software exists.

@DRCRecoveryData
Copy link
Author

DRCRecoveryData commented Sep 20, 2021 via email

@zvezdochiot
Copy link

❓ Maybe you should play with the dct coefficients? For example, as in https://github.com/ImageProcessing-ElectronicPublications/jpegquant ?

@zvezdochiot
Copy link

@cuuhodrc say:

how can i fix the color of this jpeg

ℹ️ Use https://github.com/ImageProcessing-ElectronicPublications/jpegrepair .

See also dmahurin/jpegrepair#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants