Page 1 of 2
Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T11:05:28-07:00
by peter
I'm having a strange problem where I get funny "bleed" at the bottom of the images.
I'm doing a basic resize operation on a host of images, the convert command line looks like:
/usr/bin/convert $image -resize ${size}x${size} $OUTDIR/$image
I'm taking in an 888x888 and making it into 420x420, 150x150, 100x100, and 50x50.
The original jpg is compressed, and I seem to be hitting a bug in conversion.
I can give examples if necessary, the behavior is consistent.
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T11:19:40-07:00
by fmw42
does it happen with other image types (gif, png, tif)?
is it jpeg2000?
what version of IM?
what version of jpeg delegate library?
can you post an example image?
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T11:41:20-07:00
by peter
fmw42 wrote:does it happen with other image types (gif, png, tif)?
is it jpeg2000?
what version of IM?
what version of jpeg delegate library?
can you post an example image?
1. Don't know about other image types, I've never tried, and I don't have any other image source types. The behavior is not consistent with all images, just a handful so far, it *might* be consistent with all, but I haven't checked them all yet. I know it consistently happens with a few that I've found, maybe 5 out of 100.
2. Not sure if it's jpeg2000 or not, how would I know? file reports:
2a. Original 888:
[pserwe@pythagoras 888]$ file 7310012519753.jpg
7310012519753.jpg: JPEG image data, JFIF standard 1.02
2b. Converted 420:
[pserwe@pythagoras 420]$ file 7310012519753.jpg
7310012519753.jpg: JPEG image data, JFIF standard 1.01
All of the other converted images also show JFIF standard 1.01
3. IM version:
[pserwe@pythagoras 150]$ convert --version
Version: ImageMagick 6.2.8 04/17/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
4. jpeg library, do you mean libjpeg?:
libjpeg.i386 6b-37 installed
libjpeg.x86_64 6b-37 installed
libjpeg-devel.i386 6b-37 installed
libjpeg-devel.x86_64 6b-37 installed
5. Example images:
The first one is the original source image (888x888), the second through the 5th are the converted output.
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T11:43:38-07:00
by peter
Interestingly, the images don't show corruption via this venue.
They are being posted in a storefront. I need to try and determine why the storefront host shows image corruption when I don't see it via apache on the box I'm converting on.
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T11:45:03-07:00
by fmw42
I don't see any bleed? Can you point that out better? Or provide another example where it is more prominent?
You do have rather old IM. Perhaps you should upgrade that and look and see if there is a more current libjpg as well.
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T15:15:48-07:00
by peter
I went ahead and upgraded the IM and libjpeg to the latest source tarballs, removed the old ones, built and installed the new.
One issue I'm having that I cannot seem to figure out when I started trying to test the new one, was:
[pserwe@pythagoras ~]$ /usr/local/bin/convert imgimport/in/888/7310012519753.jpg -resize 420x420 imgimport/out/420/7310012519753.jpg
convert: missing an image filename `imgimport/out/420/7310012519753.jpg' @ convert.c/ConvertImageCommand/2822.
[pserwe@pythagoras ~]$
Basically echoes the exact same command line I've been using for weeks with the older CentOS-version of convert.
Did something change dramatically? I can't even get this version to work at all at this point.
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T15:17:16-07:00
by peter
[pserwe@pythagoras ~]$ /usr/local/bin/convert --version
Version: ImageMagick 6.5.6-9 2009-10-06 Q16 OpenMP
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
[pserwe@pythagoras ~]$ ldd /usr/local/bin/convert
libMagickCore.so.2 => /usr/local/lib/libMagickCore.so.2 (0x00002acf4f638000)
libMagickWand.so.2 => /usr/local/lib/libMagickWand.so.2 (0x00002acf4fa77000)
libtiff.so.3 => /usr/lib64/libtiff.so.3 (0x0000003447a00000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x0000003042c00000)
libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x0000003041800000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x0000003043c00000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x0000003041c00000)
libXt.so.6 => /usr/lib64/libXt.so.6 (0x000000303b400000)
libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x0000003446a00000)
libz.so.1 => /usr/lib64/libz.so.1 (0x000000303b000000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000303a800000)
libdl.so.2 => /lib64/libdl.so.2 (0x000000303a400000)
libSM.so.6 => /usr/lib64/libSM.so.6 (0x0000003046800000)
libICE.so.6 => /usr/lib64/libICE.so.6 (0x0000003047000000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x0000003041000000)
libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00002acf4fdb1000)
libm.so.6 => /lib64/libm.so.6 (0x000000303ac00000)
libc.so.6 => /lib64/libc.so.6 (0x000000303a000000)
libjpeg.so.7 => /usr/local/lib/libjpeg.so.7 (0x00002acf4ffba000)
libexpat.so.0 => /lib64/libexpat.so.0 (0x0000003043000000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x0000003040400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003039c00000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x0000003040800000)
librt.so.1 => /lib64/librt.so.1 (0x000000303bc00000)
[pserwe@pythagoras ~]$
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T15:54:36-07:00
by fmw42
if you installed from source, then you need to install all the delegate libraries, such as libjpeg for jpg file type.
see
http://www.imagemagick.org/download/delegates/
but I would search the web for more current versions
you can check what IM knows about using
convert -list configure
and looking at the line starting with
DELEGATES
for example for my system, I have
DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr openexr png tiff x11 xml zlib
but you only need install the ones you want to use
You can also do
convert -list type
and see if jpg has rw+ next to it
If you install any delegates now, then I believe you will have to reinstall IM afterwards
P.S. I downloaded your original ...888.jpg and I don't see anything odd about its properties using
identify -verbose image.jpg
where were you viewing them? what browser? could it be an upload problem to your server?
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T16:28:35-07:00
by peter
Didn't see anything about jpg +rw from convert -list type, I did see jpg in delegates:
[pserwe@pythagoras ~]$ convert -list type
Bilevel
ColorSeparation
ColorSeparationMatte
Grayscale
GrayscaleMatte
Optimize
Palette
PaletteBilevelMatte
PaletteMatte
TrueColorMatte
TrueColor
[pserwe@pythagoras ~]$
DELEGATES bzlib fontconfig freetype jpeg jng png tiff x11 xml zlib
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:01:28-07:00
by fmw42
sorry,
convert -list format
but looks like you have jpeg from the DELEGATES
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:09:43-07:00
by peter
fmw42 wrote:sorry,
convert -list format
but looks like you have jpeg from the DELEGATES
Yes, one would think so, but it seems I only have rw-, not rw+.
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (70)
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (70)
I basically only want this tool for jpeg support, but I need to be able to write the files
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:16:49-07:00
by fmw42
try reinstalling libjpeg (get the most current version), then recompile IM and check again
P.S. I am wrong about the +. On my system I get the same
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (62)
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (62)
and I can write to jpg. Looking at the bottom of the listing I see + support for multiple images
and JPG does not support multi-frame images, as does gif or png.
So something else is not right and this is beyond me.
Did you check the permissions on the directory you want to write to?
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:21:50-07:00
by peter
So,
It turns out that by looking at the file in photoshop, we can see where it wasn't completely written out.
Obviously, the ancient build of ImageMagick that is provided by CentOS has a problem, so at this point,
I just need to figure out how to build it with rw+ support for jpeg, and everything should be okay.
Peter
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:23:07-07:00
by fmw42
check my post above. you cant have + and it does not matter. you only need rw-
Re: Odd image bleed when using convert under CentOS in a script.
Posted: 2009-10-06T18:25:02-07:00
by peter
fmw42 wrote:try reinstalling libjpeg (get the most current version), then recompile IM and check again
P.S. I am wrong about the +. On my system I get the same
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (62)
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (62)
and I can write to jpg. Looking at the bottom of the listing I see + support for multiple images
and JPG does not support multi-frame images, as does gif or png.
So something else is not right and this is beyond me.
Did you check the permissions on the directory you want to write to?
Yep, I reinstalled the latest libjpeg and recompiled IM, are there any options to configure on either one of those that I need to be aware of?
Peter