-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix parsing of bitmap resources #156
Conversation
@TerryFogg I've fixed the checklist for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work with these! Thanks for the important fix.
Just some comments and it should be good to merge
MetadataProcessor.Tests/Core/Utility/nanoBitmapProcessorTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Bitmap as embedded resources were not working.
Note:
Mono.Cecil reader returns resources as strings, and System.Byte[ ].
System.Drawing.Bitmap is read by Mono.Cecil as a System.Byte[ ].
A try to convert the System.Byte[ ] is the only way to detect bitmaps.
Motivation and Context
Embedding resources has been an issue.
The work around was to embed byte arrays of images and use as a binary resource.
This fix allows embedding resources of jpeg,gif,and many bitmap types.
How Has This Been Tested
Created a C# example that displays the bitmaps.
Paint.net was used to import a 32 bit colour image and save in various qualities.
JPEG - 2K bytes.
JPEG - 9K bytes.
JPEF - 12KB bytes ( best for this image size)
GIF - 9KB, dither =8.
GIF - 9KB, dither = 0.
NOTE: Bitmaps are read and then re-written as a16 bit rgb565 format resulting in a 16,520 byte size for all of these examples.
Bitmap - (1Bit) 2KBytes - stored in Flash as 16,520 (Increase)
Bitmap - (4Bit) 5KBytes - stored in Flash as 16,520 (Increase)
Bitmap - (8Bit) 10KBytes - stored in Flash as 16,520 (Increase)
Bitmap - (24it) 24KBytes - stored in Flash as 16,520 (decrease)
Bitmap - (32Bit) 33KBytes - stored in Flash as 16,520 (decrease)
Screenshots
Types of changes
Checklist: