imagemagick-deno icon indicating copy to clipboard operation
imagemagick-deno copied to clipboard

Does it works for PDF files too?

Open JulienLecoq opened this issue 1 year ago • 1 comments

I'm trying to read a PDF file and every time I try, I get this error:

error: Uncaught (in promise) Error: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBi
ts=4 -dGraphicsAlphaBits=4 '-r72x72' -dPrinted=false  '-sOutputFile=/tmp/magick-BpJ_DS4NDVs4hz7B32Q9WkfPVnJmPJFN%d' '-f/tmp/magick-HFgrZ0nlH_Dk1jSFaGrtegMHXkiNiFiL' '-f/tmp/magick-o0WiEnqt2l8LP2WfTIMApk1OJ0GdhmNd''
 (-1) @ error/delegate.c/ExternalDelegateCommand/520
    const error = new MagickError(errorMessage, severity);
                  ^
    at Function.createError (https://deno.land/x/[email protected]/src/internal/exception/exception.ts:105:19)
    at Function.throw (https://deno.land/x/[email protected]/src/internal/exception/exception.ts:93:29)
    at Function.checkException (https://deno.land/x/[email protected]/src/internal/exception/exception.ts:62:22)
    at https://deno.land/x/[email protected]/src/internal/exception/exception.ts:48:24
    at Function.use (https://deno.land/x/[email protected]/src/internal/pointer/pointer.ts:27:14)
    at Function.use (https://deno.land/x/[email protected]/src/internal/exception/exception.ts:45:20)
    at MagickImage.readOrPing (https://deno.land/x/[email protected]/src/magick-image.ts:2693:15)
    at MagickImage.read (https://deno.land/x/[email protected]/src/magick-image.ts:2064:10)
    at https://deno.land/x/[email protected]/src/image-magick.ts:207:17
    at Function._disposeAfterExecution (https://deno.land/x/[email protected]/src/internal/disposable.ts:20:22)

If I do the same with a JPEG image, it works perfectly and I don't get any error.

JulienLecoq avatar Oct 21 '23 22:10 JulienLecoq

You should ask to the original author: https://github.com/dlemstra/magick-wasm This code is just a port to make it working on Deno. But it doesn't support SVG formats so I guess PDF neither.

oscarotero avatar Oct 21 '23 23:10 oscarotero