-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wand issues MissingDelegateError error when reading pdfs and tiffs as blobs, but no errors with jpgs #352
Comments
Could you try changing the code with Image() as pages:
pages.format = 'pdf'
pages.read(blob=bytes) |
Hong, Sure. Code and output below. There is a different, but related, error: ValueError: 'pdf' is unsupported format Output from this test:
Code used for the test:
I also tried
I do have a /tmp directory, my hard drive is far from full, and there are other 'magic-xxxxxxx' files in the /tmp directory, so I am pretty confident ImageMagic can read and write that directory. Thanks for looking into this!! Mark |
A quick update. I have been experimenting with different image and pdf files. It seems that the original jpg file I used was just a lucky choice. I have other jpg files that fail. I thought it might be file size related, because I took a large jpg that failed and reduced it to a smaller size, and that file worked. However, a gif file of 31052 bytes in size worked, and a jpg file of 30150 bytes failed. The error message for all pdfs is 'pdf' is unsupported format". All the image file errors are "no decode delegate for this image format `' @ error/blob.c/BlobToImage/367" I can send you the test files if you want. Mark |
Another update. I replaced reading the files from binary with reading the files from the file system in my test program, and wand processed all of the files with no errors. So, I would say there is something broken in the reading of blobs versus files from the file system. Hope that helps! Mark |
@pmi123 I'm facing a similar here. Would you be kind and let me know how you read the files from file system? My code doesnt have any of the |
I am trying to convert one of the pdf but it's giving me wand.CorruptImage exception, Though it is able to convert most of the pdf but for few it's giving the error. I checked the pdf to I can open in adobe, foxit, IE so it doesn't seem to be a problem with pdf. Can anyone help me in identifying what could be the possible reason for the error this is how I am loading the pdf:
Here is detail error. Traceback (most recent call last): |
I'm facing a similar problem, when I tried to open some files on wand the code gives me the following error: But I can convert the file through command lines (convert file.pdf file.jpg) using imagemagick. My code in python: def pdf_image(file, dir): Is anyone have some thoughts about a solution? Thank you in advance |
Issue should be resolved with #410, just be sure to use |
I am using ImageMagick 6.7.7-10 2017-07-31 Q16 on Ubuntu 14.04, through Wand 0.4.4, Python 3.4.3 and Django 1.11. I am trying to create a jpg thumbnail of a pdf file.
On the command line, I can do this with no errors:
convert -thumbnail x300 -background white -alpha remove Lucy.pdf[0] output_thumbnail.jpg
But when I try to use wand on the same image I get this error:
To remove django from the equation, I wrote a simple Python script to test my django code:
I run this script in the same virtual environment of my django application. It generates the following output. Note that (1) it prints the correct version of GS, 9.10, and it prints out all the delegates it found, which include the delegates for pdfs and tiffs. However, it raises a delegate error when I try to process pdfs or tiffs.
I think the bug is in how wand processes byte arrays, as that is how I am giving the file to wand. I have attached the test files.
Lucy.pdf
Thanks!
Mark
The text was updated successfully, but these errors were encountered: