convert from file type BMP to PNG bug

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
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

convert from file type BMP to PNG bug

Post by Timbi »

Hello everyone!

I try to explain my problem as best as I can.

I have many bitmaps and when I'm converting by simple method

Code: Select all

convert "bitmap.bmp" "bitmap.png"
or

Code: Select all

magick convert "bitmap.bmp" "bitmap.png"
the file is indeed converted, but the header still remains for BITMAP "BM" so the programs have trouble with recognizing it.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert from file type BMP to PNG bug

Post by glennrp »

What does

Code: Select all

magick -list format | grep PNG
tell you about your installed libpng version?
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

Thanks for the respond

The version is 1.6.20

About OR operator and grep, it fails the command line, I'm at Windows Console, but that's another thing which doesn't matter now.

Isn't the bug related to bad element of structure and adding input file header to output instead of producing new header?
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

OK, the best version which works is 6.8.8-3 and available at
http://ftp.icm.edu.pl/packages/ImageMag ... static.exe

Something serious was messed up in the never versions because sometimes works (after format), sometimes not. Note that I didn't checked every version after this, it was a random choice. The 6.9.2 and newer has that bug too and many others like problem with "PNG32:" parameter.

Maybe it's related to some Windows package, but there are no informations on main page which should be downloaded.
Last edited by Timbi on 2016-05-14T11:35:30-07:00, edited 1 time in total.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert from file type BMP to PNG bug

Post by glennrp »

Does the "-debug" output give you anything helpful?

Code: Select all

magick convert -debug coder "bitmap.bmp" "bitmap.png"
or

Code: Select all

magick convert -debug coder bitmap.bmp bitmap.png
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

Yes.
There are few differecnes in file interpretation and few errors. :/
Maybe I don't have installed something?

Here are debug info both from working and not working versions.

The goal: create PNG file from BMP8bit indexed colors with alpha channel based on a certain color.

The code I have used for both versions to achieve above goal is:

Code: Select all

@ECHO OFF
rem ImageMagick path:
PATH = "C:\Program Files\ImageMagick-6.8.8-Q16\"

rem convert BMP to PNG
for %%f in (*.bmp) do (

rem create alpha channel of the bitmap
convert "%%~nf.bmp" -fill white -fuzz 0% +opaque "#980088" "outputa.bmp"
convert "outputa.bmp" -fill black -opaque "#980088" "outputa.bmp"

rem replace alpha color to black
convert "%%~nf.bmp" -fill black -opaque "#980088" "outputrgb.bmp"

rem create png file based on outputrgb and outputa bitmaps
convert "outputrgb.bmp" "outputa.bmp" -compose CopyOpacity -composite -debug coder PNG32:"%%~nf.png"

rem clean up
del "outputa.bmp"
del "outputrgb.bmp"

)

pause
del *.bmp

ECHO ON
The input image (BMP)
Image

output:
Image
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert from file type BMP to PNG bug

Post by glennrp »

The "not working" one ends with
  • convert: unable to load module 'C:\Program Files\ImageMagick-7.0.1-Q16\modules\c
    oders\IM_MOD_RL_png_.dll': Nie można odnaleźć określonego modułu.
    @ error/module.c/OpenModule/1275.
    convert: no encode delegate for this image format `PNG32' @ warning/constitute.c
    /WriteImage/1153.
which indicates that libpng wasn't properly installed, or that
you are using an incorrect link to libpng.
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

I checked something. I moved folder with these "missing" files to other place, and then convert throws the errors only in English and it didn't generated any images. It behave different than with the files in proper place. It looks like some part of the program know where the files are, and some can't find them but they are in the correct path which is thrown in the error. It's strange. The program was installed correctly, just like older working version.
There was also restart to check if it could help with some path registering, but it didn't helped.
I can check more versions and see from which the error appears.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert from file type BMP to PNG bug

Post by fmw42 »

Perhaps it got corrupted. Have you tried re-installing the delegate and perhaps IM?
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

Finally I got it working.
The static version helped. I'm not sure why there are so many versions if only one works best.

Sorry if this mightly was a false alarm of a bug, but when someone will reproduce it, maybe will find the answer here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert from file type BMP to PNG bug

Post by fmw42 »

Perhaps it was just a re-install that made it work.
Timbi
Posts: 7
Joined: 2016-05-14T05:23:36-07:00
Authentication code: 1151

Re: convert from file type BMP to PNG bug

Post by Timbi »

I'm not sure. I reinstalled it many times and tested. Then I went here to describe the problem.

Previously I used installation file named "ImageMagick-7.0.1-3-Q16-x64-dll.exe"
Now "ImageMagick-7.0.1-3-Q16-x64-static.exe" and is good. :)
Post Reply