Problem applying transformation on tiff images using wand

204 Views Asked by At

I am using wand package to convert a pdf file to tif file. I called Image. transform function to resize the image. Below is the code snippet

with Image(filename='sample.pdf') as img:
    img.format='TIF'
    img.transform('50%')
    img.save(filename='sample.tif')

the code throw an xception:wand.exceptions.OptionError: invalide geometry ' @ error/geometry.c/ParseRegionGeometry/1524 I tried transform('800x1100'). it did not work either

1

There are 1 best solutions below

1
emcconville On

I believe the argument format for Image.transform() is the following...

from wand.image import Image

with Image(filename='sample.pdf') as img:
    img.transform(resize='50%')
    img.save(filename='sample.tif')