简体   繁体   中英

Resize an image with python 2.4: The _imaging C module is not installed

How to resize an image with python 2.4 version.I am trying t make it a thumbnail

I have downloaded thePIL librrary but am facing the same problem as https://stackoverflow.com/questions/4134966/problem-in-the-installed-pil .

Is there any other way to resize the image

from PIL import Image
import glob, os

size = 40, 40

for infile in glob.glob("*.jpg"):
  file, ext = os.path.splitext(infile)
  im = Image.open(infile)
  im.thumbnail(size, Image.ANTIALIAS)
  im.save(file + ".thumbnail", "JPEG")

raise ImportError("The _imaging C module is not installed")

I think that is the same question : PIL error: The _imaging C module is not installed

I hope that it will fix your problem !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM