EPS conversion issue if geometry is larger than bounding box

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
eero
Posts: 1
Joined: 2012-02-28T06:32:34-07:00
Authentication code: 8675308

EPS conversion issue if geometry is larger than bounding box

Post by eero »

Source image (EPS, CMYK):
http://office.crasman.fi/~eero/imagick/sample.eps

Target image (JPG, CMYK):
http://office.crasman.fi/~eero/imagick/sample.jpg

Software versions are ImageMagick 6.7.5-6 2012-02-21 Q16 and GPL Ghostscript 9.04 (2011-08-05)

I'm trying to convert EPS image to JPEG.

convert sample.eps sample.jpg

This is what happens: target image size becomes 612 x 729 (this is what identify reports as "Geometry" for sample.eps), but actual image (207 x 204, this is what "ps:HiResBoundingBox" is) is located on bottom left corner of resulting image, and all other parts of image is white. See for sample target image (sample.jpg, CMYK format).

Imagemagick identifies this source image like this:

Geometry: 612x792+0+0
(Why isn't this 207 x 204 ?)

HiResBoundingBox-information shows real image size:
ps:HiResBoundingBox: 207x204+0+0

I think that the problem is that imagemagick should make conversion using bounding box size, not geometry. Or then there's probably something wrong with reading geometry from EPS image.

With older imagemagick everything works fine (version 6.7.2-6 2011-09-15 Q16), I think that recent EPS bounding box fixes caused this.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: EPS conversion issue if geometry is larger than bounding

Post by magick »

There was a transient bug in ImageMagick which we fixed a few days ago. Look for ImageMagick-6.7.5-8 within a few days that includes the patch.
Flauschi
Posts: 5
Joined: 2012-04-09T13:23:55-07:00
Authentication code: 8675308

Re: EPS conversion issue if geometry is larger than bounding

Post by Flauschi »

Hey Team!
Is the bug still present in 6.7.6.1.Q16?
Same issue.
have large set of eps contain pictures in hiresbox.
convert from eps to jpg
imagemagick uses geometry instead of hiresbox.
Any Suggestions?
Could upload samples if needed.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: EPS conversion issue if geometry is larger than bounding

Post by magick »

We'll need the samples. Once we can reproduce the problem, we'll come up with a fix.
Flauschi
Posts: 5
Joined: 2012-04-09T13:23:55-07:00
Authentication code: 8675308

Re: EPS conversion issue if geometry is larger than bounding

Post by Flauschi »

thanks for reply.
here are the samples.
input eps
http://dl.dropbox.com/u/61665700/test.eps
created jpg
http://dl.dropbox.com/u/61665700/test.jpg

creating eps preview with gs works well respecting bounding box
http://dl.dropbox.com/u/61665700/testepspreview.eps
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: EPS conversion issue if geometry is larger than bounding

Post by magick »

Ok, got them. What is the exact conversion command you are using? We convert with 'convert test.eps test.jpg' and get the expected results. We're using ImageMagick 6.7.6-5.
Flauschi
Posts: 5
Joined: 2012-04-09T13:23:55-07:00
Authentication code: 8675308

Re: EPS conversion issue if geometry is larger than bounding

Post by Flauschi »

i simply used
convert test.eps test.jpg

im on win7ultimate imagemagick 6.7.6-5 2012-04-04 -q8

convert -verbose test.eps test.jpg

"C:/Program Files/gs/gs9.05/bin/gswin64c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAU
SE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-
sDEVICE=pamcmyk32" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r300x300" -g2525x25
12 "-sOutputFile=AppData/Local/Temp/magick-KaWjw1fz-%08d" "-fC:
/Users/Flo530/AppData/Local/Temp/magick-63oWuWDS" "-fC:/Users/Flo530/AppData/Loc
al/Temp/magick-PveJWCqo"
/AppData/Local/Temp/magick-KaWjw1fz-00000001 PAM 2525x2512 2525x2
512+0+0 8-bit ColorSeparation DirectClass 25.37MB 0.078u 0:00.076
test.eps PS 2524x2512=>2525x2512 2525x2512+0+0 8-bit ColorSeparation DirectClass
25.37MB 0.016u 0:00.014
test.eps=>test.jpg PS 2524x2512=>2525x2512 2525x2512+0+0 8-bit ColorSeparation D
irectClass 2.933MB 1.014u 0:01.167
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: EPS conversion issue if geometry is larger than bounding

Post by magick »

Interesting. Your image has an embedded Photoshop profile that declares the resolution to be 300 x 300. We use that to render the image. Should we instead render at the default resolution of 72 x 72 and then set the resolution to 300x300 per the Photoshop profile?
Flauschi
Posts: 5
Joined: 2012-04-09T13:23:55-07:00
Authentication code: 8675308

Re: EPS conversion issue if geometry is larger than bounding

Post by Flauschi »

im a bit confused
isnt it the same problem?
identify with verbose show´s me
the real image size in
ps:hiresboundingbox 606x603+0+0
but image magick use base geometry 2525x2512
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: EPS conversion issue if geometry is larger than bounding

Post by magick »

Look for a patch for this problem in ImageMagick 6.7.6-6 when its released later this week. Thanks.
Flauschi
Posts: 5
Joined: 2012-04-09T13:23:55-07:00
Authentication code: 8675308

Re: EPS conversion issue if geometry is larger than bounding

Post by Flauschi »

thanks alot :)
christian.lanconelli
Posts: 1
Joined: 2013-05-31T07:39:49-07:00
Authentication code: 6789

Re: EPS conversion issue if geometry is larger than bounding

Post by christian.lanconelli »

On Fedora 17 IM 6.7.5-6, still with a problem that look like that posted here.

The correct size of the image is not identified when convertign a postscript to jpg (for example).
Get here the files http://www.isac.cnr.it/~radiclim/pagela ... d_bbox.tar (tmp.jpg is converted with a previous version of IM e.g 6.6, tmp-err.jpg with IM 6.7).
Running identify -verbose on tmp.ps appears to recognize bbox correctly but image size "incorrectly". Any idea?
Post Reply