imagick readImage 陷入系统错误事件黑洞
Imagick readImage falling into system error event blackhole
我正在尝试安装 imagick(到目前为止这不是一件容易的事,但是在 https://mlocati.github.io/articles/php-windows-imagick.html 上使用 [filter] 帮助很大)和 运行 在我的 WAMP/Windows10/PHP7.0 webapp,但我 运行 在 readImage() 调用中陷入了黑洞(日志文件只上升到 'checkpoint 2')。
查看 Windows 系统事件日志,我可以看到错误级别应用程序事件读取:
Faulting application name: httpd.exe, version: 2.4.23.0, time stamp: 0x5776399f
Faulting module name: php_imagick.dll, version: 7.0.10.0, time stamp: 0x58927660
Exception code: 0xc0000409
Fault offset: 0x000000000002468c
Faulting process ID: 0x4ba8
Faulting application start time: 0x01d44f71d980b2f3
Faulting application path: C:\wamp64\bin\apache\apache2.4.23\bin\httpd.exe
Faulting module path: C:\wamp64\bin\php\php7.0.18\ext\php_imagick.dll
Report ID: 1b3f5a6d-ed31-4fae-b73d-ebf0d17e9c94
Faulting package full name:
Faulting package-relative application ID:
当 运行 通过我的 WAMP
以下代码时出现此错误
<?php
class Test {
public function doTrace($msgTx) {
$dt=date('[D M d H:i:s Y]', gmdate(time()));
error_log($dt.$msgTx."\n",3, "C:/test.log" );
}
public function doTest() {
$fn='C:/test.pdf';
if ( file_exists($fn) ) {
$im = new Imagick();
$this->doTrace("checkpoint 1");
$im->setResolution(300, 300);
$this->doTrace("checkpoint 2");
$im->readImage($fn."[0]"); //[0] for the first page
$this->doTrace("checkpoint 3");
$im->setImageFormat('png');
$this->doTrace("checkpoint 4");
header('Content-Type: image/png');
echo $im;
$this->doTrace("checkpoint 5");
}
else {
echo "Did not find $fn";
}
}
}
$try = new Test();
$try->doTest();
?>
我只是在尝试 readImage (http://php.net/manual/en/imagick.readimage.php#116812) 的手动输入版本,所以这里有什么问题吗?我是否错误地安装了 Imagick (php_imagick-3.4.3-7.0-ts-vc14-x64) 还是其他原因? (注意,我可以让 IM 进行一些简单的测试)
我的 phpinfo() 读取:
imagick
imagick module enabled
imagick module version 3.4.3
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
Imagick using ImageMagick library version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
ImageMagick copyright Copyright (C) 1999-2015 ImageMagick Studio LLC
ImageMagick release date 2016-03-27
ImageMagick number of supported formats: 234
ImageMagick supported formats 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FITS, FPX, FRACTAL, FTS, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YCbCr, YCbCrA, YUV
谢谢
安倍
因此,在没有明显解决方案的情况下,我决定尝试不同的方向,看看是否可以 运行 通过命令行转换命令。这让我不得不安装 Ghostscript (https://www.ghostscript.com/download/gsdnld.html)。
现在安装了 Ghostscript,PHP 似乎可以正常工作了 - 我得到了 PDF 第一页的图像。
我是否在安装说明中遗漏了这一点(我不记得提到过 Ghostscript)?
一个
我正在尝试安装 imagick(到目前为止这不是一件容易的事,但是在 https://mlocati.github.io/articles/php-windows-imagick.html 上使用 [filter] 帮助很大)和 运行 在我的 WAMP/Windows10/PHP7.0 webapp,但我 运行 在 readImage() 调用中陷入了黑洞(日志文件只上升到 'checkpoint 2')。
查看 Windows 系统事件日志,我可以看到错误级别应用程序事件读取:
Faulting application name: httpd.exe, version: 2.4.23.0, time stamp: 0x5776399f
Faulting module name: php_imagick.dll, version: 7.0.10.0, time stamp: 0x58927660
Exception code: 0xc0000409
Fault offset: 0x000000000002468c
Faulting process ID: 0x4ba8
Faulting application start time: 0x01d44f71d980b2f3
Faulting application path: C:\wamp64\bin\apache\apache2.4.23\bin\httpd.exe
Faulting module path: C:\wamp64\bin\php\php7.0.18\ext\php_imagick.dll
Report ID: 1b3f5a6d-ed31-4fae-b73d-ebf0d17e9c94
Faulting package full name:
Faulting package-relative application ID:
当 运行 通过我的 WAMP
以下代码时出现此错误<?php
class Test {
public function doTrace($msgTx) {
$dt=date('[D M d H:i:s Y]', gmdate(time()));
error_log($dt.$msgTx."\n",3, "C:/test.log" );
}
public function doTest() {
$fn='C:/test.pdf';
if ( file_exists($fn) ) {
$im = new Imagick();
$this->doTrace("checkpoint 1");
$im->setResolution(300, 300);
$this->doTrace("checkpoint 2");
$im->readImage($fn."[0]"); //[0] for the first page
$this->doTrace("checkpoint 3");
$im->setImageFormat('png');
$this->doTrace("checkpoint 4");
header('Content-Type: image/png');
echo $im;
$this->doTrace("checkpoint 5");
}
else {
echo "Did not find $fn";
}
}
}
$try = new Test();
$try->doTest();
?>
我只是在尝试 readImage (http://php.net/manual/en/imagick.readimage.php#116812) 的手动输入版本,所以这里有什么问题吗?我是否错误地安装了 Imagick (php_imagick-3.4.3-7.0-ts-vc14-x64) 还是其他原因? (注意,我可以让 IM 进行一些简单的测试)
我的 phpinfo() 读取:
imagick
imagick module enabled
imagick module version 3.4.3
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
Imagick using ImageMagick library version ImageMagick 6.9.3-7 Q16 x64 2016-03-27 http://www.imagemagick.org
ImageMagick copyright Copyright (C) 1999-2015 ImageMagick Studio LLC
ImageMagick release date 2016-03-27
ImageMagick number of supported formats: 234
ImageMagick supported formats 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FITS, FPX, FRACTAL, FTS, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YCbCr, YCbCrA, YUV
谢谢
安倍
因此,在没有明显解决方案的情况下,我决定尝试不同的方向,看看是否可以 运行 通过命令行转换命令。这让我不得不安装 Ghostscript (https://www.ghostscript.com/download/gsdnld.html)。
现在安装了 Ghostscript,PHP 似乎可以正常工作了 - 我得到了 PDF 第一页的图像。
我是否在安装说明中遗漏了这一点(我不记得提到过 Ghostscript)?
一个