diff --git a/common/splash_source.c b/common/splash_source.c
index 62763b9ebd5698b454280a6d4b62cd23a7312786..1b454d3046b2d00f0a3b4da954442304579fbf4e 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -95,7 +95,26 @@ static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr)
 		return res;
 
 	bmp_hdr = (struct bmp_header *)bmp_load_addr;
-	bmp_size = le32_to_cpu(bmp_hdr->file_size);
+
+	if ((bmp_hdr->signature[0] == 'B') &&
+	      (bmp_hdr->signature[1] == 'M')) {
+		bmp_size = le32_to_cpu(bmp_hdr->file_size);
+	} else if ((bmp_hdr->signature[0] == 0x1f) &&
+			      (bmp_hdr->signature[1] == 0x8b)) {
+		char *sz = getenv("splashsize");
+
+		bmp_size = 0;
+		if (sz)
+			bmp_size = simple_strtoul(sz, 0, 16);
+		if (!bmp_size) {
+			printf("Error: specify env splashsize\n");
+			return -EINVAL;
+		}
+	} else {
+		printf("Error: unrecognized splash file type %02x %02x\n",
+			bmp_hdr->signature[0], bmp_hdr->signature[1]);
+		return -EINVAL;
+	}
 
 	if (bmp_load_addr + bmp_size >= gd->start_addr_sp)
 		goto splash_address_too_high;