220 likes | 300 Views
A bug in PhotoPlus. When PhotoPlus X2, version 12.0.2.11, is used to create a new .bmp file, it does not create the Pixel Data correctly
E N D
A bug in PhotoPlus • When PhotoPlus X2, version 12.0.2.11, is used to create a new .bmp file, it does not create the Pixel Data correctly • This bug may have been removed in later versions of the package but we will consider it in some detail here, because it illustrates how frequently software packages have bugs or "features" which deviate from the standards they are supposed to follow
Creating a new .bmp file in PhotoPlus • We are starting a new 4-by-4 image
Creating a new .bmp file in PhotoPlus • We have just painted the pixels
Creating a new .bmp file in PhotoPlus • We are just about to export the image to test4By4.bmp
Viewing the new .bmp file in PhotoPlus • We are about to open the image we just created in test4By4.bmp
Viewing the new .bmp file in PhotoPlus • The image in test4By4.bmp appears wrong when we open it • Let's try to view it in other programs
Viewing the new .bmp file in MS Paint • The test4By4.bmp image also appears wrong in MS Paint
Viewing the new .bmp file in Opera • The test4By4.bmp image also appears wrong in Opera
Viewing the new .bmp file in Firefox • The test4By4.bmp image also appears wrong in Firefox
Viewing the new .bmp file in XVI32 • It is easy to see that the image in test4By4.bmp is not what we stored • All the Pixel Data bytes are 00 • So they are pointing to the same entry in the Colour Table
Creating an (almost) correct .bmp file in PhotoPlus • We cannot export a new correct .bmp file from PhotoPlus, but ... • When Photoplus imports a correct .bmp file (one created by another editor, including XVI32), it seems not to introduce errors when we subsequently export it • Also, when Photplus imports an almost correct .jpg file, it creates a correct .bmp file when we export the image as a .bmp
Creating, indirectly, an (almost) correct .bmp file in PhotoPlus • We have just painted the pixels for a new image • We are about to export the image as .jpg file
Creating, indirectly, an (almost) correct .bmp file in PhotoPlus • We have just opened the .jpg file containing the image we exported • The image looks correct • We are about to export the newly opened image as .bmp file
Examining the (almost) correct .bmp file in PhotoPlus • We have just opened the newly exported .bmp file • It looks correct, but is it? • On the next slide, we will examine the .bmp file in XVI32
Examining the (almost) correct .bmp file in XVI32 • The Pixel Data look correct • There are four sequences of four bytes • 00 00 00 00 01 01 01 01 00 00 00 00 01 01 01 01 • On the next slide, we will look at the Colour Table
Examining the (almost) correct .bmp file in XVI32 • The Colour Table is not quite right • The Green is correct: 00 FF 00 00 • But the Red is slightly off: 00 00 FE 00 • This is a result of the sampling done when the .jpg file was exported • As we will see on the next slide, there is something else ...
Examining the (almost) correct .bmp file in XVI32 • There is also a problem in the Info Header • The ColorsUsed and ColorsImportant fields are set to all zeros • This is wrong • ColoursUsed should 00 01 00 00 • ColorsImportant should be 02 00 00 00 • The fact that the .bmp file displays correctly in PhotoPlus, MS Paint and the various browsers just shows that these programs do not pay much attention to these two fields in the Info Header
Correcting the (almost) correct .bmp file in XVI32 • We can correct the .bmp file by setting the bytes highlighted below to the values shown • Below, we have just saved the edited image in a file called test4By4newCorrected.bmp • On the next few slides, we will view this file in various programs
Viewing the corrected .bmp file in PhotoPlus • Below, we have just opened the image in test4By4newCorrected.bmp in PhotoPlus • It looks fine
Viewing the corrected .bmp file in MS Paint • Below, we have just opened the image in test4By4newCorrected.bmp in MS Paint • It looks fine
Viewing the corrected .bmp file in Opera • Below, we have just opened the image in test4By4newCorrected.bmp in Opera • It looks fine
Viewing the corrected .bmp file in Firefox • Below, we have just opened the image in test4By4newCorrected.bmp in Firefox • It looks fine