#271 Blank result for BMP resize

v1.0_(example)
closed-fixed
None
5
2014-08-22
2014-06-25
Eric
No

Hi,

I'm currently using GraphicsMagick in version 1.3.18.
When I execute the following command, the output file is white :

gm convert source.bmp -resize 288x288 dest.jpg

Here is the output of identify command :

Image: source.bmp
Format: BMP (Microsoft Windows bitmap image)
Geometry: 603x282
Class: DirectClass
Type: true color with transparency
Depth: 8 bits-per-pixel component
Channel Depths:
Red: 8 bits
Green: 8 bits
Blue: 8 bits
Opacity: 1 bits
Channel Statistics:
Red:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 61406.16 (0.9370)
Standard Deviation: 10107.81 (0.1542)
Green:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 60016.05 (0.9158)
Standard Deviation: 12311.87 (0.1879)
Blue:
Minimum: 0.00 (0.0000)
Maximum: 65535.00 (1.0000)
Mean: 58888.53 (0.8986)
Standard Deviation: 15745.52 (0.2403)
Opacity:
Minimum: 65535.00 (1.0000)
Maximum: 65535.00 (1.0000)
Mean: 65535.00 (1.0000)
Standard Deviation: 0.00 (0.0000)
Opacity: (255,255,255,255) #FFFFFFFF
Resolution: 37.8x37.8 pixels/centimeter
Filesize: 664.3K
Interlace: No
Orientation: Unknown
Background Color: white
Border Color: #DFDFDF00
Matte Color: #BDBDBD00
Page geometry: 603x282+0+0
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: Undefined
Signature: 6190e950ece44fb3e9464a486e51b37adf3b97868aaee5951a9333cf91e9676b
Tainted: False

Paint is able to read the source file without problem, but the "gm display" command render the image like a transparent filter.

This issue occurs under Windows 64bits & Linux 64bits (CentOS 6)

For information, I tried to convert the image with ImageMagick and the convertion has succeeded.

BR,
Eric

1 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2014-06-25

    It seems that it is believed that the BMP has a transparency channel which is all completely transparent. We will of course investigate.

    As a temporary workaround try

    gm convert source.bmp +matte -resize 288x288 dest.jpg
    
     
  • Eric

    Eric - 2014-06-27

    Thank you, with this option the output is correct.

    BR,
    Eric

     
  • Glenn Randers-Pehrson

    The bug is not in the PNG writer, and doesn't seem to have anything to do with the "-resize" option; "gm convert source.bmp source.txt" also creates an all-transparent image. I'm having a look at the bmp decoder now.

    It looks like a mixup of "alpha" and "opacity".

    In coders/bmp.c, ImageMagick has

    SetPixelAlpha(q,ScaleShortToQuantum((unsigned short) opacity));
    

    while GraphicsMagick has

    q->opacity=ScaleShortToQuantum(opacity);
    

    when decoding BMP files with alpha.

     
    Last edit: Glenn Randers-Pehrson 2014-07-20
  • Bob Friesenhahn

    Bob Friesenhahn - 2014-07-27
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2014-07-27

    This problem is fixed by Glenn Randers-Pehrson's commit to bmp.c on 2014-07-20. Thanks for reporting this long-term problem.

     
  • Eric

    Eric - 2014-08-07

    Hi,

    Many thanks for your job.
    Have you a due date for the release that will include this fix?

    BR,
    Eric

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2014-08-07

    There is no "due date" (as such) but as of yesterday evening all the "blockers" I am aware of for a new release have been removed. I plan to go through the whole release process with the next set of development snapshots to prove that everything is ok.

    The main task with preparing the next release is with updating documentation and merging development code to the release branch.

    Unless something unforeseen happens (e.g. struck by lightning) I should be able to produce a new release within the next couple of weeks.

     
  • Eric

    Eric - 2014-08-19

    Thanks for the release!

    Eric

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks