2017-03-15 6 views
0

JPEG로 변환 할 수 없습니다 :GraphicsMagick : PDF 나는 여러 JPEG 파일을 PDF 문서 (95 페이지)를 변환하려고하지만 오류가 무엇입니까

$gm version 
GraphicsMagick 1.3.25 2016-09-05 Q8 http://www.GraphicsMagick.org/ 
Copyright (C) 2002-2016 GraphicsMagick Group. 
Additional copyrights and licenses apply to this software. 
See http://www.GraphicsMagick.org/www/Copyright.html for details. 

Feature Support: 
    Native Thread Safe  yes 
    Large Files (> 32 bit) yes 
    Large Memory (> 32 bit) yes 
    BZIP      no 
    DPS      no 
    FlashPix     no 
    FreeType     no 
    Ghostscript (Library) yes 
    JBIG      no 
    JPEG-2000    no 
    JPEG      yes 
    Little CMS    no 
    Loadable Modules   no 
    OpenMP     yes (200805) 
    PNG      no 
    TIFF      yes 
    TRIO      no 
    UMEM      no 
    WebP      no 
    WMF      no 
    X11      no 
    XML      no 
    ZLIB      no 

Host type: x86_64-unknown-linux-gnu 

Configured using the command: 
    ./configure '--prefix=/usr/local' '--with-modules=yes' '--with-libtiff' '--with-jpeg' '--with-gslib' 

Final Build Parameters: 
    CC  = gcc -std=gnu99 
    CFLAGS = -fopenmp -g -O2 -Wall -pthread 
    CPPFLAGS = 
    CXX  = g++ 
    CXXFLAGS = -pthread 
    LDFLAGS = 
    LIBS  = -ltiff -ljpeg -lgs -lm -lgomp -lpthread 
: 여기

$gm convert -verbose -density 300 TESTIO.pdf +adjoin FOO-%02d.jpg 
[ghostscript library] "-q" "-dBATCH" "-dSAFER" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=pnmraw" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r300x300" "-sOutputFile=/tmp/gm2BfrxJ" "--" "/tmp/gmWNsJU0" "-c" "quit"Error: /ioerror in --showpage-- 
Operand stack: 
    1 true 
Execution stack: 
    %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 24 1 95 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- 1745 0 9 %oparray_pop --nostringval-- --nostringval-- 
Dictionary stack: 
    --dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:76/200(L)-- --dict:76/200(L)-- --dict:106/127(ro)(G)-- --dict:286/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:22/40(L)-- 
Current allocation mode is local 
Last OS error: 28 
GPL Ghostscript 8.70: Unrecoverable error, exit code 1 
gm convert: Unexpected end-of-file (/tmp/gm2BfrxJ). 

는 GraphicsMagick에 대한 설정입니다 또한

: 첫째

$ gs -version 
GPL Ghostscript 9.20 (2016-09-26) 
Copyright (C) 2016 Artifex Software, Inc. All rights reserved. 
+0

/tmp 파일 시스템이 가득 찼습니까? –

답변

0

, 당신은 고대 버전을 사용하는 귀하의 GraphicsMagick에서 Ghostscript의. 나는 버전이 9.20을 반환했다는 것을 알고 있지만, 게시 한 오류 로그를 보면 "GPL Ghostscript 8.70 : Unrecoverable error, exit code 1"이 표시됩니다. 따라서 GraphicsMagick 설치는 8.70을 사용하고 있습니다.

이것은 모든 출력 파일이 동일한 파일 이름으로 전송된다는 사실에서 비롯된 것 같습니다. 스위치 -sOutputFile=/tmp/gm2BfrxJ은 모든 페이지를 단일 파일에 기록합니다. 여러 파일로 이동하려면 여러 페이지 출력을 지정해야합니다 (예 : -sOutputFile=/tmp/gm2BfrxJ-%d 또는 이와 유사).

이 문제는 단순히 GraphicsMagick이 이와 같은 여러 페이지 파일을 처리하도록 설정되어 있지 않은 것으로 의심됩니다. 한 번에 한 페이지 씩 변환하십시오. 또는 Ghostscript에서 페이지를 JPEG로 렌더링합니다.

+0

Ghostscript 9.04를 설치 했는데도 다음 명령을 실행할 때 나타납니다 : gm convert -density 300x300 TESTIO.pdf -resample 25 -scene 1 + adjoin pdf_conversion_ % d.JPEG, GraphicsMagick은 여전히 ​​Ghostscript 8.7을 찾고 있습니다. 어떻게해야합니까? GhostScript 9.04로 GraphicsMagick을 컴파일하십시오. GraphicsMagick에 대한 나의 컴파일, make, make는 다음과 같다 : ./configure --prefix =/usr/local --with-modules = yes --with-tiff --with-jpeg --with-gslib, make, sudo make install – kamal

+0

GraphicsMagick에 관해서는 말할 수 없습니다, 죄송합니다. 내 의혹은 Ghostscript 공유 객체를 사용하는 것일 수도 있습니다. – KenS