将iphone的heif格式照片转为jpg格式
需要先安装依赖包 pip install pillow-heif -i https://pypi.org/simple
然后执行转换代码
from PIL import Image
import pillow_heif
# 注册HEIF支持到Pillow
pillow_heif.register_heif_opener()
# 打开并转换
img = Image.open("IMG_6107.heic")
img.convert("RGB").save("IMG_6107.JPG", "JPEG", quality=80)