'ImagickException','NoDecodeDelegateForThisImageFormat`TMP'@ error / construct.c / ReadImage / 501'

I try to install magick, and works, but when i need to work with PDF file i have error.

I use xampp

  • php 5.6
  • Compiler MSVC11 (Visual C++ 2012)
  • Architecture x86
  • Thread Safety enabled
  • 64bit system
  • windows Server 2012 R2

Bin/Dlls:

  • php_imagick-3.1.2-5.6-ts-vc11-x86
  • ImageMagick-6.9.3-7-vc11-x86

I try to install ghostpcl-9.27-win32.

version:

  • ImageMagick 7.0.8-48 Q16 x86 2019-06-01

    $im = new Imagick();
    $im->setResolution(300,300);
    $im->readimage($pdf->tmp_name);
    $im->setImageFormat('jpeg');     
    $im->cropImage(500, 500, 50, 1420);
    $im->writeImage($pdf->tmp_name . '.jpg'); 
    $im->clear(); 
    $im->destroy();
    

Fatal error: Uncaught exception 'ImagickException' with message 'NoDecodeDelegateForThisImageFormat `TMP' @ error/constitute.c/ReadImage/501' in C:\xampp\htdocs\adm_engemed_ts5\eol\scr\savePDF.php:60 Stack trace: #0 C:\xampp\htdocs\adm_engemed_ts5\eol\scr\savePDF.php(60): Imagick->readimage('C:\xampp\tmp\ph...') #1 {main} thrown in C:\xampp\htdocs\adm_engemed_ts5\eol\scr\savePDF.php on line 60

$im->queryFormats();

When i use:

array(234) {
  [0]=>
  string(3) "3FR"
  [1]=>
  string(3) "AAI"
  [2]=>
  string(2) "AI"
  [3]=>
  string(3) "ART"
  [4]=>
  string(3) "ARW"
  [5]=>
  string(3) "AVI"
  [6]=>
  string(3) "AVS"
  [7]=>
  string(3) "BGR"
  [8]=>
  string(4) "BGRA"
  [9]=>
  string(4) "BGRO"
  [10]=>
  string(3) "BIE"
  [11]=>
  string(3) "BMP"
  [12]=>
  string(4) "BMP2"
  [13]=>
  string(4) "BMP3"
  [14]=>
  string(3) "BRF"
  [15]=>
  string(3) "CAL"
  [16]=>
  string(4) "CALS"
  [17]=>
  string(6) "CANVAS"
  [18]=>
  string(7) "CAPTION"
  [19]=>
  string(3) "CIN"
  [20]=>
  string(3) "CIP"
  [21]=>
  string(4) "CLIP"
  [22]=>
  string(9) "CLIPBOARD"
  [23]=>
  string(4) "CMYK"
  [24]=>
  string(5) "CMYKA"
  [25]=>
  string(3) "CR2"
  [26]=>
  string(3) "CRW"
  [27]=>
  string(3) "CUR"
  [28]=>
  string(3) "CUT"
  [29]=>
  string(4) "DATA"
  [30]=>
  string(3) "DCM"
  [31]=>
  string(3) "DCR"
  [32]=>
  string(3) "DCX"
  [33]=>
  string(3) "DDS"
  [34]=>
  string(5) "DFONT"
  [35]=>
  string(4) "DJVU"
  [36]=>
  string(3) "DNG"
  [37]=>
  string(3) "DOT"
  [38]=>
  string(3) "DPS"
  [39]=>
  string(3) "DPX"
  [40]=>
  string(4) "DXT1"
  [41]=>
  string(4) "DXT5"
  [42]=>
  string(3) "EMF"
  [43]=>
  string(4) "EPDF"
  [44]=>
  string(3) "EPI"
  [45]=>
  string(3) "EPS"
  [46]=>
  string(4) "EPS2"
  [47]=>
  string(4) "EPS3"
  [48]=>
  string(4) "EPSF"
  [49]=>
  string(4) "EPSI"
  [50]=>
  string(3) "EPT"
  [51]=>
  string(4) "EPT2"
  [52]=>
  string(4) "EPT3"
  [53]=>
  string(3) "ERF"
  [54]=>
  string(3) "EXR"
  [55]=>
  string(3) "FAX"
  [56]=>
  string(4) "FITS"
  [57]=>
  string(3) "FPX"
  [58]=>
  string(7) "FRACTAL"
  [59]=>
  string(3) "FTS"
  [60]=>
  string(2) "G3"
  [61]=>
  string(3) "GIF"
  [62]=>
  string(5) "GIF87"
  [63]=>
  string(8) "GRADIENT"
  [64]=>
  string(4) "GRAY"
  [65]=>
  string(6) "GROUP4"
  [66]=>
  string(2) "GV"
  [67]=>
  string(1) "H"
  [68]=>
  string(4) "HALD"
  [69]=>
  string(3) "HDR"
  [70]=>
  string(9) "HISTOGRAM"
  [71]=>
  string(3) "HRZ"
  [72]=>
  string(3) "HTM"
  [73]=>
  string(4) "HTML"
  [74]=>
  string(3) "ICB"
  [75]=>
  string(3) "ICO"
  [76]=>
  string(4) "ICON"
  [77]=>
  string(3) "IIQ"
  [78]=>
  string(4) "INFO"
  [79]=>
  string(6) "INLINE"
  [80]=>
  string(3) "IPL"
  [81]=>
  string(6) "ISOBRL"
  [82]=>
  string(7) "ISOBRL6"
  [83]=>
  string(3) "J2C"
  [84]=>
  string(3) "J2K"
  [85]=>
  string(3) "JBG"
  [86]=>
  string(4) "JBIG"
  [87]=>
  string(3) "JNG"
  [88]=>
  string(3) "JNX"
  [89]=>
  string(3) "JP2"
  [90]=>
  string(3) "JPC"
  [91]=>
  string(3) "JPE"
  [92]=>
  string(4) "JPEG"
  [93]=>
  string(3) "JPG"
  [94]=>
  string(3) "JPM"
  [95]=>
  string(3) "JPS"
  [96]=>
  string(3) "JPT"
  [97]=>
  string(4) "JSON"
  [98]=>
  string(3) "K25"
  [99]=>
  string(3) "KDC"
  [100]=>
  string(5) "LABEL"
  [101]=>
  string(3) "M2V"
  [102]=>
  string(3) "M4V"
  [103]=>
  string(3) "MAC"
  [104]=>
  string(6) "MAGICK"
  [105]=>
  string(3) "MAP"
  [106]=>
  string(4) "MASK"
  [107]=>
  string(3) "MAT"
  [108]=>
  string(5) "MATTE"
  [109]=>
  string(3) "MEF"
  [110]=>
  string(4) "MIFF"
  [111]=>
  string(3) "MKV"
  [112]=>
  string(3) "MNG"
  [113]=>
  string(4) "MONO"
  [114]=>
  string(3) "MOV"
  [115]=>
  string(3) "MP4"
  [116]=>
  string(3) "MPC"
  [117]=>
  string(4) "MPEG"
  [118]=>
  string(3) "MPG"
  [119]=>
  string(3) "MRW"
  [120]=>
  string(3) "MSL"
  [121]=>
  string(4) "MSVG"
  [122]=>
  string(3) "MTV"
  [123]=>
  string(3) "MVG"
  [124]=>
  string(3) "NEF"
  [125]=>
  string(3) "NRW"
  [126]=>
  string(4) "NULL"
  [127]=>
  string(3) "ORF"
  [128]=>
  string(3) "OTB"
  [129]=>
  string(3) "OTF"
  [130]=>
  string(3) "PAL"
  [131]=>
  string(4) "PALM"
  [132]=>
  string(3) "PAM"
  [133]=>
  string(5) "PANGO"
  [134]=>
  string(7) "PATTERN"
  [135]=>
  string(3) "PBM"
  [136]=>
  string(3) "PCD"
  [137]=>
  string(4) "PCDS"
  [138]=>
  string(3) "PCL"
  [139]=>
  string(3) "PCT"
  [140]=>
  string(3) "PCX"
  [141]=>
  string(3) "PDB"
  [142]=>
  string(3) "PDF"
  [143]=>
  string(4) "PDFA"
  [144]=>
  string(3) "PEF"
  [145]=>
  string(3) "PES"
  [146]=>
  string(3) "PFA"
  [147]=>
  string(3) "PFB"
  [148]=>
  string(3) "PFM"
  [149]=>
  string(3) "PGM"
  [150]=>
  string(5) "PICON"
  [151]=>
  string(4) "PICT"
  [152]=>
  string(3) "PIX"
  [153]=>
  string(5) "PJPEG"
  [154]=>
  string(6) "PLASMA"
  [155]=>
  string(3) "PNG"
  [156]=>
  string(5) "PNG00"
  [157]=>
  string(5) "PNG24"
  [158]=>
  string(5) "PNG32"
  [159]=>
  string(5) "PNG48"
  [160]=>
  string(5) "PNG64"
  [161]=>
  string(4) "PNG8"
  [162]=>
  string(3) "PNM"
  [163]=>
  string(3) "PPM"
  [164]=>
  string(7) "PREVIEW"
  [165]=>
  string(2) "PS"
  [166]=>
  string(3) "PS2"
  [167]=>
  string(3) "PS3"
  [168]=>
  string(3) "PSB"
  [169]=>
  string(3) "PSD"
  [170]=>
  string(4) "PTIF"
  [171]=>
  string(3) "PWP"
  [172]=>
  string(15) "RADIAL-GRADIENT"
  [173]=>
  string(3) "RAF"
  [174]=>
  string(3) "RAS"
  [175]=>
  string(3) "RAW"
  [176]=>
  string(3) "RGB"
  [177]=>
  string(4) "RGBA"
  [178]=>
  string(4) "RGBO"
  [179]=>
  string(3) "RGF"
  [180]=>
  string(3) "RLA"
  [181]=>
  string(3) "RLE"
  [182]=>
  string(3) "RMF"
  [183]=>
  string(3) "RW2"
  [184]=>
  string(3) "SCR"
  [185]=>
  string(10) "SCREENSHOT"
  [186]=>
  string(3) "SCT"
  [187]=>
  string(3) "SFW"
  [188]=>
  string(3) "SGI"
  [189]=>
  string(5) "SHTML"
  [190]=>
  string(3) "SIX"
  [191]=>
  string(5) "SIXEL"
  [192]=>
  string(12) "SPARSE-COLOR"
  [193]=>
  string(3) "SR2"
  [194]=>
  string(3) "SRF"
  [195]=>
  string(7) "STEGANO"
  [196]=>
  string(3) "SUN"
  [197]=>
  string(3) "SVG"
  [198]=>
  string(4) "SVGZ"
  [199]=>
  string(4) "TEXT"
  [200]=>
  string(3) "TGA"
  [201]=>
  string(9) "THUMBNAIL"
  [202]=>
  string(4) "TIFF"
  [203]=>
  string(6) "TIFF64"
  [204]=>
  string(4) "TILE"
  [205]=>
  string(3) "TIM"
  [206]=>
  string(3) "TTC"
  [207]=>
  string(3) "TTF"
  [208]=>
  string(3) "TXT"
  [209]=>
  string(4) "UBRL"
  [210]=>
  string(5) "UBRL6"
  [211]=>
  string(3) "UIL"
  [212]=>
  string(4) "UYVY"
  [213]=>
  string(3) "VDA"
  [214]=>
  string(5) "VICAR"
  [215]=>
  string(3) "VID"
  [216]=>
  string(4) "VIFF"
  [217]=>
  string(4) "VIPS"
  [218]=>
  string(3) "VST"
  [219]=>
  string(4) "WBMP"
  [220]=>
  string(4) "WEBP"
  [221]=>
  string(3) "WMF"
  [222]=>
  string(3) "WMV"
  [223]=>
  string(3) "WPG"
  [224]=>
  string(3) "X3F"
  [225]=>
  string(3) "XBM"
  [226]=>
  string(2) "XC"
  [227]=>
  string(3) "XCF"
  [228]=>
  string(3) "XPM"
  [229]=>
  string(3) "XPS"
  [230]=>
  string(2) "XV"
  [231]=>
  string(5) "YCbCr"
  [232]=>
  string(6) "YCbCrA"
  [233]=>
  string(3) "YUV"
}
douqiao8370
douqiao8370 我尝试但不行。:(
一年多之前 回复
doubeng1278
doubeng1278 可能是policy.xml问题。请参阅stackoverflow.com/questions/52861946/....或者您可能需要将Ghostscript的完整路径放入您的delegates.xml文件中,其中包含gs。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐