Can't write png file
Posted: 2012-10-24T00:26:39-07:00
As title, I can't write png file using Magick++, other format like jpg, gif are all right.
But the convert or mogrify can correctly deal with png.
My code for test is extremely easy.
The logo.dpx can be get using
The error message is
I use ImageMagick-6.7.9-6 build from source using below configuration
Please let me know if you need any other information to help solve this problem
But the convert or mogrify can correctly deal with png.
My code for test is extremely easy.
Code: Select all
#include <Magick++.h>
using namespace Magick;
int main(int argc, char* argv[])
{
InitializeMagick(*argv);
Image image("logo.dpx");
image.write("logo.png");
return 0;
}
Code: Select all
convert logo: -alpha off -depth 10 logo.dpx
Code: Select all
terminate called after throwing an instance of 'Magick::ErrorResourceLimit'
what(): ImageMagick: memory allocation failed `logo.png' @ error/png.c/WriteOnePNGImage/8982
Aborted
Code: Select all
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=yes yes
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 yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes yes
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes no
FreeType --with-freetype=yes yes
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (8.71)
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/type1/gsfonts/
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes no
LCMS v1 --with-lcms=yes no
LCMS v2 --with-lcms2=yes no
LQR --with-lqr=yes no
LZMA --with-lzma=yes no
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes yes
PERL --with-perl=no no
PANGO --with-pango=yes no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= yes
XML --with-xml=yes no
ZLIB --with-zlib=yes yes
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS = -lSM -lICE
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.7.9
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -pthread -I/usr/include/OpenEXR -fopenmp -g -O2 -Wall -pthread
CPPFLAGS = -I/usr/local/include/ImageMagick
PCFLAGS = -fopenmp
DEFS = -DHAVE_CONFIG_H
LDFLAGS = -L/usr/lib
MAGICK_LDFLAGS = -L/usr/local/lib -L/usr/lib
LIBS = -lMagickCore -ltiff -lfreetype -ljpeg -lpng12 -lfftw3 -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lz -lm -lgomp -lpthread
CXX = g++
CXXFLAGS = -g -O2 -pthread
FEATURES = OpenMP