Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 86c057a..f0865c7 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -38,6 +38,8 @@ ahead by whole lines, or read the next chunk of the current line */ +#include "misc.h" +#include <sprintf.h> @@ -353,6 +355,8 @@ int read_bmp_fd(int fd, int format, const struct custom_format *cformat) { + char log_filename[MAX_PATH]; + int lfh=-1; struct bmp_header bmph; int padded_width; int read_width; @@ -369,6 +373,7 @@ int read_bmp_fd(int fd, bool dither = false; bool transparent = false; + create_numbered_filename(log_filename, "", "bmploaddump", ".log", 4 IF_CNFN_NUM_(, NULL)); if { remote = true; @@ -560,7 +565,18 @@ int read_bmp_fd(int fd, lseek(fd, (off_t)letoh32(bmph.off_bits), SEEK_SET); memset(bitmap, 0, totalsize); - + lfh = creat(log_filename); + if + { + fdprintf(lfh, "Reading BMP file\n" + " width: %d\n" + " height: %d\n" + " depth: %d\n", src_dim.width, src_dim.height, depth); + fdprintf(lfh, "Output:\n" + " width: %d\n" + " height: %d\n" + " format: %s\n", bm->width, bm->height, cformat ? "custom" : (remote ? "remote" : (format & FORMAT_NATIVE ? "native" : "mono" ))); + } struct bmp_args ba = { .fd = fd, .padded_width = padded_width, .read_width = read_width, .width = src_dim.width, .depth = depth, .palette = palette, @@ -572,6 +588,11 @@ int read_bmp_fd(int fd, if { + if + { + fdprintf(lfh, "calling scaler\n"); + close(lfh); + } if (resize_on_load(bm, dither, &src_dim, &rset, bitmap + totalsize, maxsize - totalsize, cformat, store_part_bmp, &ba)) @@ -695,6 +716,8 @@ int read_bmp_fd(int fd, r = (31 * q0.red + (q0.red >> 3) + delta) >> 8; g = (63 * q0.green + (q0.green >> 2) + delta) >> 8; b = (31 * q0.blue + (q0.blue >> 3) + delta) >> 8; + if && lfh >= 0) + fdprintf(lfh,"OVERFLOW ERROR: r: %d g: %d b: %d delta: %d",r,g,b,delta); *dest++ = LCD_RGBPACK_LCD(r, g, b); } /* LCD_DEPTH */ @@ -717,5 +740,7 @@ int read_bmp_fd(int fd, } } + if + close(lfh); return totalsize; /* return the used buffer size. */ } |