Hi,
I am running on Mac OS High Sierra
The following commands work fine with ImageMagick 6.9.0
convert -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
I updated ImageMagick 6.9.0 to ImageMagick 7.0.7-28 then both of these commands started failing with the below error messages
magick -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
magick: improper image header `/var/folders/tb/11n2czg57ts9dzxypdsmlqk99c46m9/T/magick-26635byT1dtHsAuT3' @ error/png.c/ReadPNGImage/4231.
magick compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
For input string: "compare: improper image header `/var/folders/tb/11n2czg57ts9dzxypdsmlqk99c46m9/T/magick-26363xwcFdjrv3CT0' @ error/png.c/ReadPNGImage/4231."
Can you please guide me what I have to change in those commands?
If I store png files in a temporary folder and run the above commands by replacing png:- with temporary file path then both the commands run fine. But I want the commands to work with InputStream.
Thanks in advance!
improper image header
improper image header
Last edited by vasdeep on 2018-04-14T22:36:55-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: improper image header
I moved this topic here since the Consulting forum is for Paid consulting only
Re: improper image header
Did anyone get chance to look at this?
Please let me know.
Please let me know.
Last edited by vasdeep on 2018-04-17T09:14:46-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: improper image header
IM 6 used convert not magick. I do not understand the use of png:- png:- in you command. Have you tried the commands with actual image files directly rather than some kind of stdin/stdout?
Re: improper image header
Thanks for the reply!
I used convert command in IM 6 but now I updated to IM 7 so I changed commands to magick. Yes the commands with actual image files directly work fine!
These were my IM 6 commands and they were working fine before upgrading to IM 7
convert -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
In IM 7, I changed the commands as below but they started throwing "Improper image header" error.
magick -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
magick compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
I used convert command in IM 6 but now I updated to IM 7 so I changed commands to magick. Yes the commands with actual image files directly work fine!
These were my IM 6 commands and they were working fine before upgrading to IM 7
convert -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
In IM 7, I changed the commands as below but they started throwing "Improper image header" error.
magick -define stream:buffer-size=0 png:- png:- -alpha off -compose copy-opacity -composite png:-
magick compare -define stream:buffer-size=0 -fuzz 17% -metric AE png:- png:- png:-
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: improper image header
There's a load of stuff on there. Can you show the problem in a single command?vasdeep wrote:Here is the GitHub project to reproduce the issue easily (JUnit test):
Using "png:-" as an input means that something must be writing, perhaps to a pipe so that magick reads it from stdin, like this:
Code: Select all
%IM%convert rose: png:- |%IMG7%magick -define stream:buffer-size=0 png:- info:
png:- PNG 70x46 70x46+0+0 8-bit sRGB 6975B 0.016u 0:00.014
snibgo's IM pages: im.snibgo.com
Re: improper image header
Thanks for your help!
It works fine after converting the pngs to MIFF.
https://stackoverflow.com/questions/498 ... gick-7-0-7
It works fine after converting the pngs to MIFF.
https://stackoverflow.com/questions/498 ... gick-7-0-7