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

Thumbs.db inverted reversed blue/red channels #3

Closed
Sembiance opened this issue Feb 20, 2022 · 5 comments
Closed

Thumbs.db inverted reversed blue/red channels #3

Sembiance opened this issue Feb 20, 2022 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Sembiance
Copy link

Greetings

Thanks so much for providing the invert option, it really works great. However I have come across a Thumbs.db file where the invert worked great, except the red in the image comes out blue.

Attached is the Thumbs.db.zip

Here is the original image:
koc_auto

Here is the thumbnail extracted with the --invert option:
koc_auto_thumb_inverted

And here it is without --invert:
koc_auto_thumb

As you can see, --invert really helps a lot, but the blue taillights should be red. Perhaps the channel conversion is buggy in some way? Or maybe this is just the way the Thumbs.db format works and there isn't a solution.

Once again, thanks for creating Vinetto.

@AtesComp
Copy link
Owner

AtesComp commented Feb 21, 2022

Yes, it does look like red is blue and blue is red. I can only speculate that the idiots at MS were (again) attempting to obfuscate an otherwise open format...JPEG...when they developed the thumbs.db format. I'm glad they got with the program in their later refactoring.

I'll look at updating the code. It may be that the images were matrix inverted which also swapped the red and blue channels. That would also account for the upside down, inverted image issues. This would fix all these perceived individual issues in one simple fix. I've been validating the image format in the binary encoding, but it's a PITA. If only I could find some actual documentation on this old format...

Thanks for finding this issue.

@AtesComp AtesComp reopened this Feb 21, 2022
@AtesComp
Copy link
Owner

Oops.

@AtesComp
Copy link
Owner

As per issue #2, you can do the following to test.

image = Image.open( strMyImageFile )
r, g, b, a = image.split()
imageRGB = Image.merge("RGB", (b, g, r))

Note the red and blue transpose.

@AtesComp
Copy link
Owner

Thanks for the samples. I think I've resolutely fixed the Type 1 issues now that I've taken a deeper dive. The "invert" option is no longer needed. Check out the new release.

@AtesComp AtesComp added the bug Something isn't working label Feb 23, 2022
@AtesComp AtesComp self-assigned this Feb 23, 2022
@AtesComp AtesComp added the enhancement New feature or request label Feb 23, 2022
@Sembiance
Copy link
Author

Just checked out the latest version, it works great! All the thumbs look spot on perfect now, no odd colorization issues. Thanks for digging into that and solving it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants