当前位置: 首页 > news >正文

Automatically Naming the Screenshots to Steam

Automatically Naming the Screenshots to Steam

The Problem

I want to upload my own screenshot to steam, but I found that the methods I found are a bit tedious.

Steam expects screenshots to follow a specific naming convention in its screenshot and thumnails folders:

YYYYMMDDHHMMSS_N.jpg

Where:

  • YYYYMMDDHHMMSS is the timestamp
  • N is a sequence number
  • .jpg is the required file format

Solution

I wrote a Python script to automate this process

import os
import shutil
from PIL import Image
from datetime import datetimedef copy_images(source_folder, destination_folder, resize_thumbnails=True, thumbnail_size=(200, 125)):"""Copy all image files from source folder to destination folder with timestamp-based naming.Optionally create thumbnails in a subfolder.Args:source_folder (str): Path to source folder containing imagesdestination_folder (str): Path to destination folderresize_thumbnails (bool): Whether to create thumbnailsthumbnail_size (tuple): Size for thumbnails if enabled"""image_extensions = ('.jpg', '.jpeg', '.png', '.bmp', '.gif', '.tiff')os.makedirs(destination_folder, exist_ok=True)if resize_thumbnails:thumbnails_folder = os.path.join(destination_folder, 'thumbnails')os.makedirs(thumbnails_folder, exist_ok=True)copied_files = 0sequence_number = 1  # Starting sequence number# Get current timestamp in YYYYMMDDHHMMSS formattimestamp = datetime.now().strftime("%Y%m%d%H%M%S")for filename in os.listdir(source_folder):if filename.lower().endswith(image_extensions):source_path = os.path.join(source_folder, filename)try:new_filename = f"{timestamp}_{sequence_number}.jpg"destination_path = os.path.join(destination_folder, new_filename)with Image.open(source_path) as img:if img.mode in ('RGBA', 'P'):img = img.convert('RGB')img.save(destination_path, 'JPEG', quality=95)copied_files += 1print(f"Saved: {new_filename}")if resize_thumbnails:thumbnail_path = os.path.join(thumbnails_folder, new_filename)thumb = img.copy()thumb.thumbnail(thumbnail_size)thumb.save(thumbnail_path, 'JPEG', quality=90)print(f"Created thumbnail: {new_filename}")sequence_number += 1except Exception as e:print(f"Error processing {filename}: {str(e)}")print(f"\nDone! Saved {copied_files} images to {destination_folder}")if resize_thumbnails:print(f"Created thumbnails in {thumbnails_folder}")if __name__ == "__main__":# Example usagesource = "C:\\Users\\miyas\\Pictures\\VRChat\\SELECT" # change to your pathdestination = "X:\\steam\\userdata\\861267303\\760\\remote\\438100\\screenshots" # change to your pathcopy_images(source, destination, resize_thumbnails=True)

How to Use the Script

  1. Install Requirements:

    pip install pillow
    
  2. Edit the Paths:

    • Change source to your screenshot folder
    • Change destination to your Steam screenshots folder (usually in steam/userdata/[yourID]/760/remote/[appID]/screenshots)
  3. Run the Script:

    python upload.py
    

    After the process done, restart steam and you will see the customized pictures in the screenshot manager.

Key Features

  1. Automatic Timestamping: Uses current time for proper Steam format
  2. Format Conversion: Converts all images to JPG automatically
  3. Thumbnail Generation: Creates 200x125 thumbnails in a subfolder
http://www.rkmt.cn/news/9850.html

相关文章:

  • 穷举法(c语言版)
  • 详细介绍:深入理解Kafka事务
  • Python - GaussDB table sync to Hive
  • 很烦不知道 自己以后要做什么,工作不会很稳定。感觉有很多东西要学习 但是 也有很多东西 不会 不知道咋办了
  • 揭秘“牛牛透视”
  • 从 Web 到 LLM,多入口、多链路的自动化威胁如何防护? - 详解
  • 【mysql】mysql5.6 版本修改用户的登录
  • 0.5*8 边形 != 式
  • [Paper Reading] METAGPT: META PROGRAMMING FOR A MULTI-AGENT COLLABORATIVE FRAMEWORK
  • 四舍六入五成双
  • 借助 Apache Phoenix,使用标准 SQL 和 JDBC 接口来操作 HBase
  • 9月22日
  • 20250922
  • 基于springboot的图书进销存管理系统 - 详解
  • react+antdesign达成后台管理系统面包屑
  • 详细介绍:深入理解 JVM 字节码文件:从组成结构到 Arthas 工具实践
  • (1-10-2)MyBatis 进阶篇 - 教程
  • Spark 性能优化全攻略:内存管理、shuffle 优化与参数调优 - 详解
  • 如何隐藏一个元素
  • 软工9.22
  • 在控制台执行可列出所有placeholder样式
  • 对于一门古老东欧玄学的初步研究的简要报告
  • Java学习笔记:从三个实验看编程思维的锤炼
  • 完整教程:App 上架平台全解析,iOS 应用发布流程、苹果 App Store 审核步骤
  • 题解:AT_arc068_d [ARC068F] Solitaire
  • Codeforces Round 1051 (Div. 2) D1D2题解
  • 深入解析:基于 Kubernetes 的湖仓一体架构部署指南
  • 完整教程:真空发生器的工作原理
  • 【分布式架构实战】Spring Cloud 与 Dubbo 深度对比:从架构到实战,谁才是微服务的王者? - 详解
  • 探展打卡 Serverless,2025 云栖大会来了