Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: utility/bmpblk_util.c

Issue 6541001: Allow yaml file to specify default compression for images (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: utility/bmpblk_util.c
diff --git a/utility/bmpblk_util.c b/utility/bmpblk_util.c
index f2b0adc8de879a2cad73fe5017255de46cee1563..5c94d8e9beca78829660745f8547b592d85e0ed8 100644
--- a/utility/bmpblk_util.c
+++ b/utility/bmpblk_util.c
@@ -264,11 +264,22 @@ int dump_bmpblock(const char *infile, int show_as_yaml,
// Write out yaml
fprintf(yfp, "bmpblock: %d.%d\n", hdr->major_version, hdr->minor_version);
- fprintf(yfp, "images:\n");
offset = sizeof(BmpBlockHeader) +
(sizeof(ScreenLayout) *
hdr->number_of_localizations *
hdr->number_of_screenlayouts);
+ // FIXME(chromium-os:12134): The bmbblock structure allows each image to be
+ // compressed differently, but we haven't provided a way for the yaml file to
+ // specify that. Additionally, we allow the yaml file to specify a default
+ // compression scheme for all images, but only if that line appears in the
+ // yaml file before any images. Accordingly, we'll just check the first image
+ // to see if it has any compression, and if it does, we'll write that out as
+ // the default. When this bug is fixed, we should just write each image's
+ // compression setting separately.
+ img = (ImageInfo *)(ptr + offset);
+ if (img->compression)
+ fprintf(yfp, "compression: %d\n", img->compression);
+ fprintf(yfp, "images:\n");
for(i=0; i<hdr->number_of_imageinfos; i++) {
img = (ImageInfo *)(ptr + offset);
sprintf(image_name, "img_%08x.bmp", offset);

Powered by Google App Engine
This is Rietveld 408576698