logo
  • 教程列表
  • SO官方文档
  • Pillow
    • 阅读图像文件
    • 将文件转换为 JPEG
  1. StackOverflow 文档
  2. Python Language 教程
  3. Pillow
  4. 将文件转换为 JPEG

将文件转换为 JPEG

Created: November-22, 2018

from __future__ import print_function
import os, sys
from PIL import Image

for infile in sys.argv[1:]:
    f, e = os.path.splitext(infile)
    outfile = f + ".jpg"
    if infile != outfile:
        try:
            Image.open(infile).save(outfile)
        except IOError:
            print("cannot convert", infile)
  • 阅读图像文件

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明