Domanda

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!

È stato utile?

Soluzione

  • 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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top