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!

有帮助吗?

解决方案

  • 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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top