Question

I'm trying to use imagemagick to take several JPGs and lay them out on a pdf

I'm at the beginning of the project and I do not understand how to open the multiple images and do this.

My research indicated to me that this is possible on the command line by simply passing the convert() function multiple files. experience is telling me that this isn't how it's done with Wand, but I can't figure out how!

Any advice is appreciated!

Was it helpful?

Solution

  • my example code is below.
  • before you excute this code, insert the dir path.

import os
from wand.image import Image
from wand.display import display

path = "____absolute_dir_path____ (ex. /home/kim/work/)"

dirList=os.listdir(path)
for fname in dirList:
    print fname
    with Image(filename=path+fname) as img:
        print img.size
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top