- /* store the resolution */
- if (xres && !yres)
- yres = xres;
- else if (yres && !xres)
- xres = yres;
- if (xres) {
- i_tags_set_float(&im->tags, "i_xres", 0, xres * 0.0254);
- i_tags_set_float(&im->tags, "i_yres", 0, yres * 0.0254);
+ if (im) {
+ /* store the resolution */
+ if (xres && !yres)
+ yres = xres;
+ else if (yres && !xres)
+ xres = yres;
+ if (xres) {
+ i_tags_set_float(&im->tags, "i_xres", 0, xres * 0.0254);
+ i_tags_set_float(&im->tags, "i_yres", 0, yres * 0.0254);
+ }
+ i_tags_addn(&im->tags, "bmp_compression", 0, compression);
+ i_tags_addn(&im->tags, "bmp_important_colors", 0, clr_important);
+ i_tags_addn(&im->tags, "bmp_used_colors", 0, clr_used);
+ i_tags_addn(&im->tags, "bmp_filesize", 0, filesize);
+ i_tags_addn(&im->tags, "bmp_bit_count", 0, bit_count);
+ i_tags_add(&im->tags, "i_format", 0, "bmp", 3, 0);