Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Webmaster Utility Scripts - ETP KIT

This directory contains utility scripts for webmaster tasks at the Institute for Experimental Particle Physics (ETP) at Karlsruhe Institute of Technology (KIT).

Scripts

pad_imgs.py

Pads images to a target aspect ratio while preserving the original image quality and metadata.

Purpose: Useful for preparing images for the website where consistent aspect ratios are needed (e.g., profile photos, gallery images).

Usage:

python pad_imgs.py <image_path>

Example:

python pad_imgs.py photo.jpg
# Output: photo_pad.jpg

Features:

  • Default aspect ratio: 2:3 (portrait orientation, needed for newsboxes on the homepage)
  • Preserves EXIF orientation data
  • Maintains ICC color profiles
  • High-quality output (95% quality for JPEG, optimized compression)
  • Smart white padding that adapts to image mode (RGB, RGBA, grayscale)
  • Automatic format detection and preservation
  • Centers the original image within the padded canvas

Supported Formats:

  • JPEG
  • PNG
  • Other PIL-supported image formats

Requirements:

  • Python 3.x
  • Pillow (PIL)

Installation:

pip install Pillow

Contributing

When adding new utility scripts to this directory, please update this README with:

  • Script name and description
  • Usage instructions
  • Requirements
  • Examples

Contact

For questions or issues related to these scripts, contact the ETP webmaster.

About

Useful Scripts for ETP Webmasters

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages