Page 1 of 1

cannot reduce jpg files in size

Posted: 2008-07-22T11:42:07-07:00
by zervakos
I've installed ImageMagick:

Version: ImageMagick 6.4.1 05/16/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

on cygwin.

When trying to reduce a .jpg, this is what happens:

$ convert -resize %25 DSC06963.JPG DSC06963_small.JPG
convert: no decode delegate for this image format `DSC06963.JPG'.
convert: missing an image filename `DSC06963_small.JPG'.


So then I tried this:
$ identify -list format
Format Module Mode Description
-------------------------------------------------------------------------------

* native blob support

Seems like .jpg is missing?

I also tried:

$ convert -debug all -resize %25 DSC06963.JPG DSC06963_small.JPG

and got lots of stuff:

2008-07-22T18:28:54+02:00 0:01 0.345u 6.4.1 Exception convert[1776]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-22T18:28:54+02:00 0:01 0.345u 6.4.1 Blob convert[1776]: blob.c/unknown/2356/Blob
read 3 magic header bytes
2008-07-22T18:28:54+02:00 0:01 0.345u 6.4.1 Module convert[1776]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-22T18:28:54+02:00 0:01 0.345u 6.4.1 Module convert[1776]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-22T18:28:54+02:00 0:01 0.391u 6.4.1 Exception convert[1776]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-22T18:28:54+02:00 0:01 0.391u 6.4.1 Cache convert[1776]: cache.c/unknown/2162/Cache
destroy
2008-07-22T18:28:54+02:00 0:01 0.391u 6.4.1 Configure convert[1776]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/magic.xml"
2008-07-22T18:28:54+02:00 0:01 0.407u 6.4.1 Configure convert[1776]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/magic.xml"
2008-07-22T18:28:54+02:00 0:01 0.407u 6.4.1 Configure convert[1776]: configure.c/unknown/482/Configure
Searching for configure file: "/home/Administrator/.magick/magic.xml"
2008-07-22T18:28:54+02:00 0:01 0.407u 6.4.1 Configure convert[1776]: configure.c/unknown/482/Configure
Searching for configure file: "magic.xml"
2008-07-22T18:28:54+02:00 0:01 0.407u 6.4.1 Configure convert[1776]: magic.c/unknown/679/Configure
Loading magic map "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/magic.xml" ...
2008-07-22T18:28:54+02:00 0:01 0.454u 6.4.1 Module convert[1776]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-22T18:28:54+02:00 0:01 0.454u 6.4.1 Module convert[1776]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-22T18:28:54+02:00 0:02 0.501u 6.4.1 Exception convert[1776]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-22T18:28:54+02:00 0:02 0.501u 6.4.1 Module convert[1776]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-22T18:28:54+02:00 0:02 0.501u 6.4.1 Module convert[1776]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-22T18:28:54+02:00 0:02 0.562u 6.4.1 Exception convert[1776]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module

I look for jpeg.la:
$ ls -l /usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la
-rwxr-xr-x 1 Administrator None 1133 May 16 23:21 /usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la

So I do have it. I installed this as a Unix binary release for cugwin from:
http://www.imagemagick.org/script/binar ... s.php#unix

Could anyone point me in the right direction?

thanks,
George

Re: cannot reduce jpg files in size

Posted: 2008-07-22T11:45:30-07:00
by Bonzo
Why do you not just run a windows version ?

Re: cannot reduce jpg files in size

Posted: 2008-07-22T11:49:45-07:00
by zervakos
I have a wrapper script written in Korn shell that I use to reduce the size of lots of jpgs so it's more convenient for me to download the pictures from my camera, then run the wrapper script and it goes and creates the reduced size files.

I used to have it working great, but then I reinstalled Windows, and Cygwin along with it and this is where the problem began.

Re: cannot reduce jpg files in size

Posted: 2008-07-22T12:16:24-07:00
by fmw42
If you manually installed IM from source, then you also need to install all the delegate libraries.

run

convert -list configure

to see what you have in the line that starts DELEGATES.

You likely will need to install at least gif, png, jpg, tiff libraries.

My system shows:

DELEGATES bzlib fontconfig freetype gs jpeg jp2 lcms lqr openexr png tiff x11 xml zlib


You can get the delegates at:

http://www.imagemagick.org/download/delegates/

Re: cannot reduce jpg files in size

Posted: 2008-07-22T12:27:15-07:00
by zervakos
Oh man I think you might be on to something. I may not have downloaded the version I thought I did. Let me go double check...

Re: cannot reduce jpg files in size

Posted: 2008-07-23T05:53:43-07:00
by zervakos
I started over so here's what I did (I apologize for the verbosity):

1) Downloaded ImageMagick-i686-pc-cygwin.tar.gz.

2) gzunzipped and unpacked into /usr/local

3) MAGICK_HOME=/usr/local/ImageMagick-6.4.1 and LD_LIBRARY_PATH=:/usr/local/ImageMagick-6.4.1/lib

4) $ convert -resize %25 DSC_1288.JPG DSC_1288_small.JPG
convert: no decode delegate for this image format `DSC_1288.JPG'.
convert: missing an image filename `DSC_1288_small.JPG'.

5) $ convert -list configure

Path: /usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/configure.xml

Name Value
-------------------------------------------------------------------------------
CC gcc
CFLAGS -g -O2 -Wall -W
CONFIGURE ./configure --disable-installed --enable-delegate-build --enable-shared --disable-static --enable-libtool-verbose --without-gslib --without-gvc --without-wmf --without-frozenpaths --without-jp2 --prefix=/ImageMagick-6.4.1 --enable-ltdl-convenience --no-create --no-recursion
COPYRIGHT Copyright (C) 1999-2008 ImageMagick Studio LLC
CPPFLAGS -I/ImageMagick-6.4.1/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -Wall -W
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib freetype jpeg png tiff zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecate --disable-installed --with-quantum-depth=16 --with-djvu=no --with-gslib=no --with-jp2=no --with-umem=no --with-wmf=no --with-fontpath= --with-fontconfig=no --with-gvc=no --with-lqr=no --with-rsvg=no --with-xml=no
EXEC-PREFIX /ImageMagick-6.4.1
HOST i686-pc-cygwin
LDFLAGS -L/ImageMagick-6.4.1/lib -L/home/Cristy/ImageMagick-6.4.1/magick -L/home/Cristy/ImageMagick-6.4.1/wand -lfreetype -lz
LIB_VERSION 0x641
LIB_VERSION_NUMBER 6,4,1,2
LIBS -lMagickCore -ltiff -lfreetype -ljpeg -lbz2 -lz -lgdi32 -lm -lpthread
NAME ImageMagick
PCFLAGS
PREFIX /ImageMagick-6.4.1
QuantumDepth 16
RELEASE_DATE 05/16/08
VERSION 6.4.1
WEBSITE http://www.imagemagick.org

6) $ convert -debug all -resize %25 DSC_1288.JPG DSC_1288_small.JPG
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: utility.c/unknown/809/Configure
Command line: convert {-debug} {all} {-resize} {%25} {DSC_1288.JPG} {DSC_1288_small.JPG}
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/coder.xml"
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/coder.xml"
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/home/Administrator/.magick/coder.xml"
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "coder.xml"
2008-07-23T14:50:35+02:00 0:01 0.000u 6.4.1 Configure convert[4856]: coder.c/unknown/634/Configure
Loading coder map "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/coder.xml" ...
2008-07-23T14:50:35+02:00 0:01 0.031u 6.4.1 Module convert[4856]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-23T14:50:35+02:00 0:01 0.031u 6.4.1 Module convert[4856]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Locale convert[4856]: locale.c/unknown/498/Locale
Searching for locale file: "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/locale.xml"
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Locale convert[4856]: locale.c/unknown/498/Locale
Searching for locale file: "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/locale.xml"
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Locale convert[4856]: locale.c/unknown/498/Locale
Searching for locale file: "/home/Administrator/.magick/locale.xml"
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Locale convert[4856]: locale.c/unknown/498/Locale
Searching for locale file: "locale.xml"
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Configure convert[4856]: locale.c/unknown/831/Configure
Loading locale map "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/locale.xml" ...
2008-07-23T14:50:35+02:00 0:02 0.078u 6.4.1 Configure convert[4856]: locale.c/unknown/831/Configure
Loading locale map "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/english.xml" ...
2008-07-23T14:50:35+02:00 0:02 0.343u 6.4.1 Exception convert[4856]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-23T14:50:35+02:00 0:02 0.343u 6.4.1 Blob convert[4856]: blob.c/unknown/2356/Blob
read 3 magic header bytes
2008-07-23T14:50:35+02:00 0:02 0.343u 6.4.1 Module convert[4856]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-23T14:50:35+02:00 0:02 0.343u 6.4.1 Module convert[4856]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Exception convert[4856]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Cache convert[4856]: cache.c/unknown/2162/Cache
destroy
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/magic.xml"
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/magic.xml"
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/home/Administrator/.magick/magic.xml"
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "magic.xml"
2008-07-23T14:50:35+02:00 0:02 0.390u 6.4.1 Configure convert[4856]: magic.c/unknown/679/Configure
Loading magic map "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/magic.xml" ...
2008-07-23T14:50:35+02:00 0:02 0.438u 6.4.1 Module convert[4856]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-23T14:50:35+02:00 0:02 0.438u 6.4.1 Module convert[4856]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-23T14:50:35+02:00 0:02 0.484u 6.4.1 Exception convert[4856]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-23T14:50:35+02:00 0:02 0.484u 6.4.1 Module convert[4856]: module.c/unknown/1077/Module
Searching for module "JPEG" using filename "jpeg.la"
2008-07-23T14:50:35+02:00 0:02 0.484u 6.4.1 Module convert[4856]: module.c/unknown/479/Module
Searching for coder module file "jpeg.la" ...
2008-07-23T14:50:35+02:00 0:02 0.531u 6.4.1 Exception convert[4856]: module.c/unknown/1092/Exception
unable to load module `/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la': can't open the module
2008-07-23T14:50:35+02:00 0:02 0.531u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/delegates.xml"
2008-07-23T14:50:35+02:00 0:02 0.531u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/usr/local/ImageMagick-6.4.1/share/ImageMagick-6.4.1/config/delegates.xml"
2008-07-23T14:50:35+02:00 0:02 0.547u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "/home/Administrator/.magick/delegates.xml"
2008-07-23T14:50:35+02:00 0:02 0.547u 6.4.1 Configure convert[4856]: configure.c/unknown/482/Configure
Searching for configure file: "delegates.xml"
2008-07-23T14:50:35+02:00 0:02 0.547u 6.4.1 Configure convert[4856]: delegate.c/unknown/1166/Configure
Loading delegate map "/usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/config/delegates.xml" ...
2008-07-23T14:50:35+02:00 0:02 0.578u 6.4.1 Exception convert[4856]: constitute.c/unknown/396/Exception
no decode delegate for this image format `DSC_1288.JPG'
2008-07-23T14:50:35+02:00 0:02 0.578u 6.4.1 Exception convert[4856]: convert.c/unknown/2651/Exception
missing an image filename `DSC_1288_small.JPG'
convert: no decode delegate for this image format `DSC_1288.JPG'.
convert: missing an image filename `DSC_1288_small.JPG'.

7) $ ls -l /usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la
-rwxr-xr-x 1 Administrator None 1133 May 16 23:21 /usr/local/ImageMagick-6.4.1/lib/ImageMagick-6.4.1/modules-Q16/coders/jpeg.la

So it looks like convert has been complied with support for the delegate library jpeg, and I also have the module in my file system, I just don't know why there's a problem when trying to open it.

George

Re: cannot reduce jpg files in size

Posted: 2008-07-23T10:04:22-07:00
by fmw42
If your jpg is jpeg200, then you need another delegate for that.