1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 86c057a..5b2ce5e 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -595,7 +595,12 @@ int read_bmp_fd(int fd,
 #endif
         unsigned mask;
         unsigned char *p;
+#if BM_MAX_WIDTH < LCD_WIDTH
+        int len;
+        if (!(len = read_part_line(&ba)))
+#else
         if (!read_part_line(&ba))
+#endif
            return -9;

         /* Convert to destination format */
@@ -691,6 +696,15 @@ int read_bmp_fd(int fd,
                 for (col = 0; col < bm->width; col++) {
                     if (dither)
                         delta = DITHERXDY(col,dy);
+#if BM_MAX_WIDTH < LCD_WIDTH
+                    if (len == 0)
+                    {
+                        if (!(len = read_part_line(&ba)))
+                            return -9;
+                        qp = (struct uint8_rgb*)ba.buf;
+                    }
+                    len--;
+#endif
                     q0 = *qp++;
                     r = (31 * q0.red + (q0.red >> 3) + delta) >> 8;
                     g = (63 * q0.green + (q0.green >> 2) + delta) >> 8;
diff --git a/apps/recorder/bmp.h b/apps/recorder/bmp.h
index c53f295..c42c0b9 100644
--- a/apps/recorder/bmp.h
+++ b/apps/recorder/bmp.h
@@ -33,7 +33,8 @@

 #define IMG_NORESIZE           0
 #define IMG_RESIZE             1
-#define BM_MAX_WIDTH (((LCD_WIDTH) + 7) & ~7)
+//#define BM_MAX_WIDTH (((LCD_WIDTH) + 7) & ~7)
+#define BM_MAX_WIDTH 8

 struct uint8_rgb {
     uint8_t blue;