如何将 iPhone 的照片同步到 windows 电脑上(非常快,不耗流量)


  • 首先在电脑上,新建一个文件夹,并把共享权限打开。
    • 文件夹 右键 属性,共享,添加 Everyone。
  • 然后,让手机和电脑连接到同一个局域网,手机热点即可。
  • 在手机端看 文件 app,找到电脑的共享文件夹。
    • 手机端 文件 连接服务器,输入电脑的 IP 地址。
    • 电脑 IP 地址查询:电脑端 【设置】/【网络和 internet】,或者 cmd ipconfig
    • 手机端连接服务器,身份不要选访客,选平常使用电脑的身份,手动输入用户名密码。
  • 把照片多选,保存到文件,保存到电脑的共享文件夹里。

参考教程:https://baijiahao.baidu.com/s?id=1798913407453799872


电脑端 处理苹果 HEIC 格式的照片,转 jpg 的代码:

import os
from PIL import Image
from pillow_heif import register_heif_opener
register_heif_opener()

'''
python ./heic_to_jpg.py
'''

heic_path = './_默认相册/'

# 得到 path 里的所有 heic 图片
heic_files = [f for f in os.listdir(heic_path) if \
              (f.endswith('.HEIC') or f.endswith('.heic'))]

for f in heic_files:
    # 打开 heic 图片
    image = Image.open(heic_path + f)
    print(f"正在处理 {f}")
    # 读取图片的拍摄时间
    exif = image.getexif() # exif[306] = '2023:04:21 13:26:38'
    # print(exif)
    if 306 in exif.keys():
        # 取出年月日时分秒
        date = exif[306].split(' ')[0].split(':') # ['2023', '04', '21']
        time = exif[306].split(' ')[1].split(':') # ['13', '26', '38']
        # 重命名图片
        new_name = f"{f[:-5]}_{date[0]}{date[1]}{date[2]}_{time[0]}{time[1]}.jpg"
        print(f"拍摄时间为 {date[0]}年{date[1]}月{date[2]}日 {time[0]}时{time[1]}分{time[2]}秒,重命名为 {new_name}")
    else:
        new_name = f"{f[:-5]}.jpg"
        print(f"没有拍摄时间信息,重命名为 {new_name}")
    
    # 把 image 保存为 jpg
    image.save(heic_path + new_name)
    # 检查 jpg 图片是否正确
    image = Image.open(heic_path + new_name)
    image.verify()
    # 删除 heic 图片
    os.remove(heic_path + f)

    # exit(0)


posted @ 2024-06-12 11:19  MoonOut  阅读(51)  评论(0编辑  收藏  举报