Commits

Anonymous committed 143b249

ICO plugin: avoid using the AND mask when loading a 32-bit (already transparent) icon

  • Participants
  • Parent commits 0007f42

Comments (0)

Files changed (1)

File Source/FreeImage/PluginICO.cpp

 	// bitmap has been loaded successfully!
 
 	// convert to 32bpp and generate an alpha channel
-	if((flags & ICO_MAKEALPHA) == ICO_MAKEALPHA) {
+	// apply the AND mask only if the image is not 32 bpp
+	if(((flags & ICO_MAKEALPHA) == ICO_MAKEALPHA) && (bit_count < 32)) {
 		FIBITMAP *dib32 = FreeImage_ConvertTo32Bits(dib);
 		FreeImage_Unload(dib);