Closed Ishantnarula21 closed 3 months ago
@Ishantnarula21 Have you tried changing your Imagick policy.xml
resource settings? This error can occur if the PDF has hi-res images or needs a lot of memory to convert to an image. Try disabling or increasing the limits for the resource
directives, which has worked for me in the past.
Also see this GitHub issue.
@patinthehat currently this is my policy.xml i have give pdf read write access
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)*>
<!ATTLIST policymap xmlns CDATA #FIXED ''>
<!ELEMENT policy EMPTY>
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
]>
<policymap>
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="map" value="512MiB"/>
<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>
<policy domain="resource" name="area" value="128MP"/>
<policy domain="resource" name="disk" value="1GiB"/>
<!-- use curl -->
<policy domain="delegate" rights="none" pattern="URL" />
<policy domain="delegate" rights="none" pattern="HTTPS" />
<policy domain="delegate" rights="none" pattern="HTTP" />
<!-- in order to avoid to get image with password text -->
<policy domain="path" rights="none" pattern="@*"/>
<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="PS2" />
<policy domain="coder" rights="none" pattern="PS3" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="read|write" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
</policymap>
I have tried with imagick directly getting this issue in this pdf is readable but this issue is there
no decode delegate for this image format `' @ error/constitute.c/ReadImage/575
@Ishantnarula21 It sounds like you might be missing a library or a related issue. See this issue in the ImageMagick repo.
Closing this issue as unrelated. Please open a new issue if you find a bug that's causing this, as all tests are currently passing. Thanks! :+1:
Failed to read the file when trying to convert pdf to jpg:
I'm encountering an error while attempting to convert a PDF file to an image using the
Pdf
class. The specific line causing the error is:Additional Context:
I've tried several approaches to resolve this issue without success. One of the attempts involved using Imagick directly, but I encountered another error stating "no decode delegate for this image format."
Error :