convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

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.
Tester12345
Posts: 7
Joined: 2017-03-01T02:14:56-07:00
Authentication code: 1151

convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by Tester12345 »

Hello,

there is a bug at convert in the append function
(both -append and +append)
The PDF results are much too high.

you can check it simply
convert flower-left.jpg flower-right.jpg +append flower-direct.pdf
-> check white space in PDF above the main pictures

the JPG append conversion is okay:
convert flower-left.jpg flower-right.jpg +append flower-direct.jpg

and also the jpg to pdf conversion...
convert flower-direct.jpg flower-direct.pdf

Tested with ImageMagick 7.0.5-0 Q16 x64 2017-02-20
on windows 10

Tester
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by snibgo »

Tester12345 wrote:The PDF results are much too high.
To help us understand the problem, please upload sample input and output files, and show the command you used. You can upload to somewhere like dropbox.com and paste the URLs here.
snibgo's IM pages: im.snibgo.com
Tester12345
Posts: 7
Joined: 2017-03-01T02:14:56-07:00
Authentication code: 1151

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by Tester12345 »

I uploaded it to
http://www.share-online.biz/dl/LGTLP5MOP9

-> ImageMagick-705-Q16-bug.zip
4 files:
Source 1: flower-left.jpg
Source 2: flower-right.jpg
Target PDF with wrong dimensions: result.pdf
Target JPG with correct dimensions: result.jpg

used commandlines win10 :
convert flower-left.jpg flower-right.jpg +append result.pdf 1150x1609
-> picture has only half height (about 575 pixel and the other half is white...)
convert flower-left.jpg flower-right.jpg +append result.jpg 2300x1609
-> picture is going over full height...

(so the complete result PDF is not much too high, it have only the half height and
the main picture have only quarter height of the input pictures.)
Last edited by Tester12345 on 2017-03-01T15:22:40-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by snibgo »

I can't get through the captcha. (Perhaps I'm a robot, ha! I always wondered.)
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by snibgo »

Yes, your output PDF is weird.

Making the PDF works fine for me, using "convert" with v6.9.5-3, or "magick" or "magick convert" with v7.0.3-5.
snibgo's IM pages: im.snibgo.com
Tester12345
Posts: 7
Joined: 2017-03-01T02:14:56-07:00
Authentication code: 1151

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by Tester12345 »

yes, I had also an older version which were working.
I thought I needed to update to the actual release...
(that's why I opened a posting :D

This is working too with the actual win version 7.0.5-0 :

Code: Select all

convert jpg1 jpg2 +append intermediate-result.jpg
convert intermediate-result.jpg result.pdf
Last edited by Tester12345 on 2017-03-02T00:00:47-07:00, edited 2 times in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by snibgo »

It looks like a recent bug.

Does the problem only occur when you append images together? Or does it also apply to non-appended image, eg:

Code: Select all

convert flower-left.jpg out.pdf
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by fmw42 »

I cannot get to your images. But the following works fine for me on IM 7.0.5.0 Q16 Mac OSX

Code: Select all

magick rose: logo: -background black +append tmp.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by fmw42 »

I finally was able to download your images and I can reproduce the white area at the top. Your files have an xif:ExifOffset: 159, but adding -strip does not seem to avoid the white padding at the top. Using both IM 6.9.7.9 and 7.0.5.0 Q16 Mac OSX

It seems to be something about your jpg files, since I can do:

Code: Select all

magick rose: rose.jpg
magick logo: logo.jpg
magick rose.jpg logo.jpg -background black +append rose_logo.pdf
and do not get any padding at the top.

Converting each of your images separately to pdf does not show any problem. But using -append puts a large white pad on the right side in a manner similar to the white pad at the top when using +append.

Code: Select all

magick flower-left.jpg flower-right.jpg -append result.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by fmw42 »

If I do the following, it seems to work

Code: Select all

magick flower-left.jpg flower-right.jpg PNG:- | magick - +append result.pdf
But replacing PNG:- with MIFF:- or TIFF:- does not work.

So it seems to be a bug in my opinion.
Tester12345
Posts: 7
Joined: 2017-03-01T02:14:56-07:00
Authentication code: 1151

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by Tester12345 »

fmw42 wrote: 2017-03-01T16:12:50-07:00 It seems to be something about your jpg files, since I can do:

Code: Select all

magick rose: rose.jpg
magick logo: logo.jpg
magick rose.jpg logo.jpg -background black +append rose_logo.pdf
and do not get any padding at the top.
Tried with wizard.png from homepage: http://imagemagick.org/script/index.php.

Code: Select all

magick wizard.png wizard.png -background black +append wizard-2.png.pdf
same buggy result
fmw42 wrote: 2017-03-01T16:28:40-07:00 If I do the following, it seems to work

Code: Select all

magick flower-left.jpg flower-right.jpg PNG:- | magick - +append result.pdf
Don't work at all. Only one wizard in PDF

Code: Select all

magick wizard.jpg wizard.jpg PNG:- | magick - +append wizard-png-param.pdf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by fmw42 »

You are correct. Even this does not work properly

Code: Select all

magick wizard.png wizard.png +append wizard-png-param.pdf

So this is even more a puzzle.
Tester12345
Posts: 7
Joined: 2017-03-01T02:14:56-07:00
Authentication code: 1151

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by Tester12345 »

checked with both available windows versions:
ImageMagick 6.9.7-9 Q16 x64 2017-02-18
ImageMagick 7.0.5-0 Q16 x64 2017-02-20

Not working:
1-step append & JPG to PDF

Code: Select all

convert wizard.jpg wizard.jpg +append wizard_twice_from_jpg.pdf
Not working:
1-step append & PNG to PDF

Code: Select all

convert wizard.png wizard.png +append wizard_twice.pdf
Not working:
2-step append & PNG to PDF

Code: Select all

convert wizard.png wizard.png +append wizard_twice.png
convert wizard_twice.png wizard_twice_2ndpass.pdf
Working:
2-step append & JPG to PDF

Code: Select all

convert wizard.jpg wizard.jpg +append wizard_twice_from_jpg.jpg
convert wizard_twice_from_jpg.jpg wizard_twice_from_jpg_2ndpass.pdf
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: convert +append from jpg to pdf -> pdf got too high / ImageMagick 7.0.5-0 Q16 x64 Windows

Post by snibgo »

Tester12345 wrote:Don't work at all. Only one wizard in PDF

Code: Select all

magick wizard.jpg wizard.jpg PNG:- | magick - +append wizard-png-param.pdf
I would expect only one wizard. This is the correct behaviour.

The first magick outputs two PNG files to the pipe, one immediately after the other. The second magick reads the pipe, but ignores any data after the first PNG is finished. (Because that's how PNG works.) So the second magick has only one image.

If you used MIFF instead of PNG, you would get two images (because that's how MIFF works).
snibgo's IM pages: im.snibgo.com
Post Reply