Page 1 of 2
Segmentation fault PDF to jpg
Posted: 2009-09-18T02:53:29-07:00
by omman95
Hello, i'm a french developper.
I would like to transform pdf to jpg.
So, I install imagemagick and gohstscript.
For information I do "convert -version"
Code: Select all
Version: ImageMagick 6.5.5-9 2009-09-17 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
and "gs -version"
Code: Select all
GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
When I do this request, file are create, all is OK.
Code: Select all
convert capFM.jpg capFM.gif
convert capFM.jpg -resize 300x300 cap1.jpg
convert capFM.jpg -resize 300x300 cap1.gif
But when I do this request, i have
"erreur de segmentation" / "segmentation fault"
Code: Select all
convert 1.pdf 1.jpg
convert 1.pdf[0] 1.png
convert 1.pdf[0] 1.gif
convert capFM.jpg capFM.png
convert capFM.jpg -resize 300x300 cap1.png
can you help me? I'm not sure about the installation of the software.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T04:59:00-07:00
by magick
Can you post a URL to your image and the specific command you use to produce the fault? We need to reproduce the problem before we can help. It is likely you have a corrupt image or image profile (e.g. EXIF).
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T06:38:14-07:00
by omman95
I don't understand a lot. You want my picture to test with your environment?
I do convert capFM.jpg capFM.png with this picture:
and I have the result : Erreur de segmentation
I do a "identify" and the result is : capFM.jpg JPEG 1266x414 1266x414+0+0 8-bit DirectClass 135kb
I don't think that the problem is the picture because if I do a convert capFM.jpg capFM.gif I don't have any problems.
What you want more ?
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T06:58:50-07:00
by magick
The conversion works without complaint for us. Its possible there is a problem with OpenMP. You can build ImageMagick without OpenMP support like this:
- cd ImageMagick-6.5.6-1
./configure --disable-openmp
make
make install
You can also try a stack trace:
- gdb convert
run capfm.jpg capfm.png
where
post the trace here for further analysis.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T07:23:07-07:00
by omman95
I do this
Code: Select all
root@srv-ubuntu:/usr/local/lib/ImageMagick-6.5.5# ./configure --disable-openmp
-bash: ./configure: Aucun fichier ou dossier de ce type
For install I do this
apt-get install imagemagick
apt-get install gohstscript
apt-get install gs
and i did any problems so I rename the folder
ImageMagick-6.5.5-9 by
ImageMagick-6.5.5 and I copy
Code: Select all
mv /usr/lib/ImageMagick-6.5.5 /usr/local/lib/ImageMagick-6.5.5
There is a relation ?
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T08:16:46-07:00
by magick
The configure command only works if you are building from source. The last option to is post a stack trace and we may be able to determine where in the ImageMagick code the process is failing.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T08:27:28-07:00
by omman95
I nothing understand, sorry... :S
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T09:29:09-07:00
by magick
To build from source, download
ftp://ftp.imagemagick.org/pub/ImageMagi ... 6-1.tar.gz and type
- tar xvfz ImageMagick-6.5.6-1.tar.gz
cd ImageMagick-6.5.6-1
./configure --disable-shared
Now look at the last 40 lines of output. Make sure it says JPEG and PNG are supported. Now type
Now try your command:
- /usr/local/bin/convert image.jpg image.png
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T09:53:41-07:00
by omman95
Code: Select all
-------------------------------------------------------------
checking for Ghostscript...
checking for Ghostscript version... 8.64
checking for gs alpha device... pnmraw
checking for gs color device... pnmraw
checking for gs CMYK device... pam
checking for gs mono device... pbmraw
checking for gs PDF writing device... pdfwrite
checking for gs PS writing device... pswrite
checking for gs EPS writing device... epswrite
-------------------------------------------------------------
Update ImageMagick configuration
configure: creating ./config.status
config.status: creating config/configure.xml
config.status: creating config/delegates.xml
config.status: creating config/ImageMagick.rdf
config.status: creating config/MagickCore.dox
config.status: creating config/MagickWand.dox
config.status: creating config/type-ghostscript.xml
config.status: creating config/type-windows.xml
config.status: creating config/type.xml
config.status: creating ImageMagick.spec
config.status: creating Magick++/bin/Magick++-config
config.status: creating magick/ImageMagick.pc
config.status: creating Magick++/lib/ImageMagick++.pc
config.status: creating Magick++/lib/Magick++.pc
config.status: creating magick/Magick-config
config.status: creating magick/MagickCore-config
config.status: creating magick/MagickCore.pc
config.status: creating magick/version.h
config.status: creating Makefile
config.status: creating magick.sh
config.status: creating PerlMagick/Magick.pm
config.status: creating PerlMagick/Makefile.PL
config.status: creating PerlMagick/check.sh
config.status: creating utilities/animate.1
config.status: creating utilities/compare.1
config.status: creating utilities/composite.1
config.status: creating utilities/conjure.1
config.status: creating utilities/convert.1
config.status: creating utilities/display.1
config.status: creating utilities/identify.1
config.status: creating utilities/ImageMagick.1
config.status: creating utilities/import.1
config.status: creating utilities/mogrify.1
config.status: creating utilities/montage.1
config.status: creating utilities/stream.1
config.status: creating wand/MagickWand-config
config.status: creating wand/MagickWand.pc
config.status: creating wand/Wand-config
config.status: creating wand/Wand.pc
config.status: creating config/config.h
config.status: executing magick/magick-config.h commands
config.status: creating magick/magick-config.h - prefix MAGICKCORE for config/config.h defines
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands
config.status: executing MagickCore-config.in commands
config.status: executing Magick-config.in commands
config.status: executing MagickWand-config.in commands
config.status: executing Wand-config.in commands
config.status: executing Magick++-config.in commands
config.status: executing PerlMagick/check.sh.in commands
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.
Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=no no
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no
Delegate Configuration:
BZLIB --with-bzlib=yes no
Autotrace --with-autotrace=no no
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=no no
FreeType --with-freetype=yes no
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (8.64)
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/type1/gsfonts/
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=yes no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes no
JPEG-2000 --with-jp2=yes no
LCMS --with-lcms=yes no
LQR --with-lqr=yes no
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes no
PERL --with-perl=no no
PNG --with-png=yes no
RSVG --with-rsvg=no no
TIFF --with-tiff=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= no
XML --with-xml=no no
ZLIB --with-zlib=yes no
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.5.6
CC = gcc -std=gnu99
CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
CPPFLAGS = -I/usr/local/include/ImageMagick
PCFLAGS = -fopenmp
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lMagickCore -lm -lgomp -lpthread
CXX = g++
CXXFLAGS = -g -O2 -Wall -W -pthread
After the ./configure --disable-shared
it's OK ?
When I do root@srv-ubuntu:/var/www# /usr/local/bin/convert capFM.jpg capFM.png
The result :
Code: Select all
convert: pas de délégué pour décoder ce format d'image `capFM.jpg' @ constitute.c/ReadImage/503.
convert: nom de fichier d'image absent `capFM.png' @ convert.c/ConvertImageCommand/2819.
For information : convert -version :
Code: Select all
Version: ImageMagick 6.5.6-1 2009-09-19 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Re: Segmentation fault PDF to jpg
Posted: 2009-09-18T13:05:28-07:00
by magick
You need to install the delegate libraries and their development headers. For example, install the libjpeg and libjpeg-devel RPMS and then run the ImageMagick configure script. You should then be able to read and write JPEG images.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-21T01:07:45-07:00
by omman95
I again don't understand.
I do apt-get install libjpeg and apt-get install libjpeg-devel
but it doesn't work...
What I have to do?
The problem isn't the location of folder because it doesn't find the xml files...
Thank for your help.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-21T03:54:34-07:00
by magick
After you run the configure script in the top-level ImageMagick folder, verify that the output claims that JPEG is not validated. If so, check config.log. Scroll down until you see where it is validating the JPEG library. If it fails to validate it will tell you why. Fix the problem and rerun the configure script until the JPEG delegate library is validated. Once it is, rebuild and reinstall ImageMagick.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-21T05:24:07-07:00
by omman95
Code: Select all
checking for JPEG...
checking jconfig.h usability... no
checking jconfig.h presence... no
checking for jconfig.h... no
checking jerror.h usability... no
checking jerror.h presence... no
checking for jerror.h... no
checking jmorecfg.h usability... no
checking jmorecfg.h presence... no
checking for jmorecfg.h... no
checking jpeglib.h usability... no
checking jpeglib.h presence... no
checking for jpeglib.h... no
checking for jpeg_read_header in -ljpeg... no
checking for JPEG library is version 6b or later... no
checking if JPEG package is complete... no
-------------------------------------------------------------
checking for JPEG Version 2...
checking jasper/jasper.h usability... no
checking jasper/jasper.h presence... no
checking for jasper/jasper.h... no
checking for jas_stream_fopen in -ljasper... no
checking if JPEG version 2 support package is complete... no
-------------------------------------------------------------
checking for LCMS...
checking lcms.h usability... no
checking lcms.h presence... no
checking for lcms.h... no
checking lcms/lcms.h usability... no
checking lcms/lcms.h presence... no
checking for lcms/lcms.h... no
checking for cmsOpenProfileFromMem in -llcms... no
checking if LCMS package is complete... no
-------------------------------------------------------------
checking for LQR...
-------------------------------------------------------------
checking for OPENEXR...
-------------------------------------------------------------
checking for PNG...
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
checking for png_get_io_ptr in -lpng... no
checking if PNG package is complete... no
-------------------------------------------------------------
checking for TIFF...
checking tiff.h usability... no
checking tiff.h presence... no
checking for tiff.h... no
checking tiffio.h usability... no
checking tiffio.h presence... no
checking for tiffio.h... no
checking for TIFFOpen in -ltiff... no
checking for TIFFClientOpen in -ltiff... no
checking for TIFFIsByteSwapped in -ltiff... no
checking for TIFFReadRGBATile in -ltiff... no
checking for TIFFReadRGBAStrip in -ltiff... no
checking if TIFF package is complete... no
-------------------------------------------------------------
checking for WMF...
checking for libwmf/ipa.h... no
checking if WMF package is complete... no
-------------------------------------------------------------
checking for ImageMagick delegate programs...
./configure: line 42858: test: -gt: unary operator expected
checking for autotrace... autotrace
checking for mplayer... mplayer
checking for ... no
checking for bzip2... /bin/bzip2
checking for xdg-open... xdg-open
checking for ralcgm... ralcgm
checking for cat... /bin/cat
checking for ufraw-batch... ufraw-batch
checking for dot... dot
checking for dvips... dvips
checking for echo... /bin/echo
checking for xterm... xterm
checking for fig2dev... fig2dev
checking for convert... /usr/local/bin/convert
checking for display... /usr/local/bin/display
checking for mogrify... /usr/local/bin/mogrify
checking for gnuplot... gnuplot
checking for ra_pfm... ra_pfm
checking for hp2xx... hp2xx
checking for html2ps... html2ps
checking for ilbmtoppm... ilbmtoppm
checking for ppmtoilbm... ppmtoilbm
checking for lp... no
checking for lpr... lpr
checking for uncompress... /bin/uncompress
checking for compress... compress
checking for gimp... gimp
checking for groff... /usr/bin/groff
checking for ffmpeg... ffmpeg
checking for ffmpeg... ffmpeg
checking for mv... /bin/mv
checking for pcl6... pcl6
checking for pgpv... pgpv
checking for povray... povray
checking for gsx... no
checking for gsc... no
checking for gs... /usr/bin/gs
checking for rawtorle... rawtorle
checking for rm... /bin/rm
checking for scanimage... scanimage
checking for enscript... enscript
checking for wmf2eps... wmf2eps
checking for curl... /usr/bin/curl
checking for gxps... gxps
checking for gzip... /bin/gzip
checking for Ghostscript fonts directory... /usr/share/fonts/type1/gsfonts/
checking for gnutar... no
checking for gtar... no
checking for tar... tar
checking for perl... perl
checking for rpmbuild... no
checking for rpm... no
checking for 7za... no
checking for zip... zip
-------------------------------------------------------------
checking for Ghostscript...
checking for Ghostscript version... 8.64
checking for gs alpha device... pnmraw
checking for gs color device... pnmraw
checking for gs CMYK device... pam
checking for gs mono device... pbmraw
checking for gs PDF writing device... pdfwrite
checking for gs PS writing device... pswrite
checking for gs EPS writing device... epswrite
-------------------------------------------------------------
checking for Perl...
checking for perl... /usr/bin/perl
checking for perl version greater than or equal to 5.8.1... ok
-------------------------------------------------------------
Update ImageMagick configuration
configure: creating ./config.status
config.status: creating config/configure.xml
config.status: creating config/delegates.xml
config.status: creating config/ImageMagick.rdf
config.status: creating config/MagickCore.dox
config.status: creating config/MagickWand.dox
config.status: creating config/type-ghostscript.xml
config.status: creating config/type-windows.xml
config.status: creating config/type.xml
config.status: creating ImageMagick.spec
config.status: creating Magick++/bin/Magick++-config
config.status: creating magick/ImageMagick.pc
config.status: creating Magick++/lib/ImageMagick++.pc
config.status: creating Magick++/lib/Magick++.pc
config.status: creating magick/Magick-config
config.status: creating magick/MagickCore-config
config.status: creating magick/MagickCore.pc
config.status: creating magick/version.h
config.status: creating Makefile
config.status: creating magick.sh
config.status: creating PerlMagick/Magick.pm
config.status: creating PerlMagick/Makefile.PL
config.status: creating PerlMagick/check.sh
config.status: creating utilities/animate.1
config.status: creating utilities/compare.1
config.status: creating utilities/composite.1
config.status: creating utilities/conjure.1
config.status: creating utilities/convert.1
config.status: creating utilities/display.1
config.status: creating utilities/identify.1
config.status: creating utilities/ImageMagick.1
config.status: creating utilities/import.1
config.status: creating utilities/mogrify.1
config.status: creating utilities/montage.1
config.status: creating utilities/stream.1
config.status: creating wand/MagickWand-config
config.status: creating wand/MagickWand.pc
config.status: creating wand/Wand-config
config.status: creating wand/Wand.pc
config.status: creating config/config.h
config.status: executing magick/magick-config.h commands
config.status: creating magick/magick-config.h - prefix MAGICKCORE for config/config.h defines
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default commands
config.status: executing MagickCore-config.in commands
config.status: executing Magick-config.in commands
config.status: executing MagickWand-config.in commands
config.status: executing Wand-config.in commands
config.status: executing Magick++-config.in commands
config.status: executing PerlMagick/check.sh.in commands
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.
Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=yes yes
Static libraries --enable-static=yes yes
Module support --with-modules=yes yes
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no
Delegate Configuration:
BZLIB --with-bzlib=yes no
Autotrace --with-autotrace=no no
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=no no
FreeType --with-freetype=yes no
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (8.64)
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/type1/gsfonts/
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=yes no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes no
JPEG-2000 --with-jp2=yes no
LCMS --with-lcms=yes no
LQR --with-lqr=yes no
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes no
PERL --with-perl=yes /usr/bin/perl
PNG --with-png=yes no
RSVG --with-rsvg=no no
TIFF --with-tiff=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=yes no
X11 --with-x= no
XML --with-xml=no no
ZLIB --with-zlib=yes no
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.5.6
CC = gcc -std=gnu99
CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
CPPFLAGS = -I/usr/local/include/ImageMagick
PCFLAGS = -fopenmp
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lMagickCore -lm -lgomp -lpthread
CXX = g++
CXXFLAGS = -g -O2 -Wall -W -pthread
This is a part of my ./configure
What I have to do know?
Re: Segmentation fault PDF to jpg
Posted: 2009-09-21T05:47:08-07:00
by magick
Notice how the configure script says it cannot find jpeglib.h. It is required and is generally available after you install the development RPM of the JPEG delegate library. If you ensure you install the JPEG delegate library and its headers, the configure script should validate JPEG and then you can expect to read and write JPEG images after you build / install ImageMagick.
Re: Segmentation fault PDF to jpg
Posted: 2009-09-21T08:07:58-07:00
by omman95
Ok how I do to install the development RPM of the JPEG delegate library ?