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')