Skip to content

Instantly share code, notes, and snippets.

View jshakes's full-sized avatar

James Shakespeare jshakes

View GitHub Profile
@jshakes
jshakes / additional_info_en.example.json
Last active January 30, 2024 14:59
Additional Info Schema example - all questions
{
"questions": [
{
"question_uuid": "baby_supplies",
"label": "Number of Children Needing Baby Supplies",
"type": "number",
"default_value": 0,
"validations": [
{
"name": "min",
@jshakes
jshakes / README.md
Last active March 17, 2025 13:12
Bulk image padding for client logo grids

pad_images.py

A Python script to pad images to match a specified aspect ratio while ensuring a minimum amount of padding around the image relative to its size. It supports multiple image formats and preserves transparency for PNG, GIF, and WEBP files.

Note the script does not resize images, it will only add padding as needed.

Features

  • Maintains the specified aspect ratio (e.g., 4:3, 16:9) across all images.
  • Ensures a minimum padding percentage based on the largest image dimension.
  • Supports PNG transparency; other formats get a white background.