identify -ping sample.bmp[0] reports incorrect resolution

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Oleksiis
Posts: 2
Joined: 2012-03-13T10:00:53-07:00
Authentication code: 8675308

identify -ping sample.bmp[0] reports incorrect resolution

Post by Oleksiis »

This is caused by the following code fragment, which terminates further processing.
coders/bmp.c (~line 897):

Code: Select all

    if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
      if (image->scene >= (image_info->scene+image_info->number_scenes-1))
        break;
    /*
      Read image data.
    */
Copying resolution from BMP header is done a bit later in the code:
coders/bmp.c (~line 941):

Code: Select all

    /*
      Initialize image structure.
    */
    image->x_resolution=(double) bmp_info.x_pixels/100.0;
    image->y_resolution=(double) bmp_info.y_pixels/100.0;
    image->units=PixelsPerCentimeterResolution;
I understand that bmp does not support multiple frames, but the first frame should work IMO.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: identify -ping sample.bmp[0] reports incorrect resolutio

Post by magick »

We'll add a patch to the ImageMagick Subversion trunk by sometime tomorrow. Thanks.
Post Reply