“-define jpeg:extent=XXkb” bug in 6.8.5?

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
paulgao
Posts: 7
Joined: 2013-03-30T04:39:42-07:00
Authentication code: 6789

“-define jpeg:extent=XXkb” bug in 6.8.5?

Post by paulgao »

I use command:

Code: Select all

/usr/local/bin/convert 11053304.jpg 11043461.jpg 11033336.jpg +append -colorspace sRGB -strip -coalesce -thumbnail 691x336^ -gravity center -extent 691x336 -fill none -stroke gray -strokewidth 1 -draw "rectangle 0,0 690,335" -format jpg test.jpg
in 6.7.4-10:
I get it 69335 bytes.

in 6.8.5-3:
I get it 70871 bytes.

and with

Code: Select all

-define jpeg:extent=82kb
in 6.7.4-10:
I get it 82231 bytes.

in 6.8.5-3:
convert Infinite loop. :-(

and with

Code: Select all

-define jpeg:extent=85kb
in 6.7.4-10:
I get it 82231 bytes.

in 6.8.5-3:
I get it 84644 bytes.

with “-define jpeg:extent=XXkb”, 6.8.5-3 convert often Infinite loop. :-(

CAN FIX IT ASAP?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by magick »

We cannot reproduce the problem. We'll need to try with your images. Post a URL to your image set and we'll try again. If we can reproduce the problem, we'll have a patch within a day.
paulgao
Posts: 7
Joined: 2013-03-30T04:39:42-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by paulgao »

for this:
Image
Image
Image
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by magick »

With your images, the -define jpeg:extent=85kb option completes for us without complaint with ImageMagick 6.8.5-4 (available later today) and returns a 84644 byte image. Note, there are several ways to affect the JPEG image size including -quality, -sampling-factor, -define jpeg:extent, and -strip.
paulgao
Posts: 7
Joined: 2013-03-30T04:39:42-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by paulgao »

magick wrote:With your images, the -define jpeg:extent=85kb option completes for us without complaint with ImageMagick 6.8.5-4 (available later today) and returns a 84644 byte image. Note, there are several ways to affect the JPEG image size including -quality, -sampling-factor, -define jpeg:extent, and -strip.
plz try

Code: Select all

-define jpeg:extent=82kb
, in my case,convert Infinite loop. :-(

plz carefully see my post, thx。
paulgao
Posts: 7
Joined: 2013-03-30T04:39:42-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by paulgao »

anybody? :-(
dpldpl
Posts: 3
Joined: 2013-08-11T13:37:33-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by dpldpl »

Hi, I can confirm such a behaviour on my system with one of my images.

Here is the command I used:

convert -define jpeg:extent=200kb img.jpg img_converted.jpg

And here is the image I used: http://img.ctrlv.in/img/5207f8c5ea8a4.jpg

Below are my system stats. I think this should perhaps be looked at again, since there are now at least 2 people with this problem of imagemagick hanging in an indefinite loop / never finishing the convert/resize/mogrify using the extent option. Am happy to help, thanks!

> mogrify --version
Version: ImageMagick 6.8.6-4 2013-07-11 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenCL Modules
Delegates: bzlib fontconfig freetype gslib jng jp2 jpeg lcms lqr lzma openexr pango png ps rsvg tiff wmf x xml zlib

> uname -a
Linux host 3.10.3-1-ARCH #1 SMP PREEMPT Fri Jul 26 11:26:59 CEST 2013 x86_64 GNU/Linux
dpldpl
Posts: 3
Joined: 2013-08-11T13:37:33-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by dpldpl »

Addendum: I can also reproduce for the first of the original author's images (didn't test other two). However and most interestingly, at first I used his pic with my setting of 200kb. that worked fine. Then, I copied his command of 82kb, and then it hung forever. Thus, it is not only image-dependent, but image-and-size-request-dependent. This should help hunt the bug down. happy to help if you need more testing. thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by snibgo »

Infinite loop confirmed using:

convert -define jpeg:extent=200kb img.jpg img_converted.jpg

on the image http://img.ctrlv.in/img/5207f8c5ea8a4.jpg

on Windows 7, IM 6.8.6.5 and 6.8.6.0.

Using "-debug all" as the first argument to convert provides some insight.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by dlemstra »

I have committed a fix to the SVN repository, this will be fixed in ImageMagick-6.8.6-9. Thanks for all the info, made it quite easy to track down the bug.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
dpldpl
Posts: 3
Joined: 2013-08-11T13:37:33-07:00
Authentication code: 6789

Re: “-define jpeg:extent=XXkb” bug in 6.8.5?

Post by dpldpl »

thanks, that was fast!!
Post Reply