0

Windows 10

Anaconda - Spyder

Python

ImageMagick 6.9.10

This seems to be a ubiquitous problem with ImageMagick on Windows systems such that you must change the Environment Variable to give permission for ImageMagick to write to a file/folder. I've read nearly every article on Google in an attempt to fix this problem.

I have added the MAGICK_HOME variable, a MAGICK_TMPDIR, and other solutions that have been proposed, however they have still not given permission to ImageMagick to open/read/write a file.

How may I fix this BlobError?

BlobError: unable to open image `C:/Users/Kenny/Documents/Scans': Permission denied @ error/blob.c/OpenBlob/2874

EDIT: I am trying to convert a scanned PDF to a .JPG file, to use for OCR.

My code is below:

import pytesseract
from pathlib import Path
from wand.image import Image

scanFolder = Path("C:/Users/Kenny/Documents/Scans")


for file in Path("C:/Users/Kenny/Documents/Scans").iterdir():
    with Image(filename="C:/Users/Kenny/Documents/Scans", resolution=300) as img:
        print('pages = ', len(img.sequence))
        with img.convert('png') as converted:
            converted.save(filename='temp.jpg')
Kenny Troy
  • 51
  • 7
  • I cannot answer your question, but there is no version 6.10.x.x. The current version is 6.9.10.15. What kind of input file are you trying to read. If PDF/EPS/PS, then you need Ghostscript installed and you may need to modify your policy.xml file to give permission for those formats. See https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 – fmw42 Dec 09 '18 at 19:45
  • 3
    It seems you are trying to open the directory as image. – Michael Butscher Dec 09 '18 at 19:47
  • Yes, I wrote a loop to open each PDF within a directory - does Wand not function as such? – Kenny Troy Dec 09 '18 at 19:50
  • Not this way. The `Image` constructor opens a single image (or PDF) file. – Michael Butscher Dec 09 '18 at 19:54

0 Answers0