Page 1 of 1

convert from file type BMP to PNG bug

Posted: 2016-05-14T05:27:37-07:00
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.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T05:40:21-07:00
by glennrp
What does

Code: Select all

magick -list format | grep PNG
tell you about your installed libpng version?

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T06:37:24-07:00
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?

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T08:55:59-07:00
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.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T10:24:16-07:00
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

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T11:08:17-07:00
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

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T12:36:22-07:00
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.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T16:01:26-07:00
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.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T16:05:03-07:00
by fmw42
Perhaps it got corrupted. Have you tried re-installing the delegate and perhaps IM?

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T16:12:26-07:00
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.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-14T17:03:27-07:00
by fmw42
Perhaps it was just a re-install that made it work.

Re: convert from file type BMP to PNG bug

Posted: 2016-05-15T10:54:23-07:00
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. :)