Spaces:
Sleeping
A newer version of the Gradio SDK is available: 6.24.0
title: Image Editor
emoji: π
colorFrom: green
colorTo: indigo
sdk: gradio
sdk_version: 5.37.0
app_file: app.py
pinned: false
ImageResizer
Batch download, resize, and export product images via a Gradio web UI. Designed for e-commerce catalog workflows where image URLs live in Excel workbooks.
Run locally
pip install -r requirements.txt
python app.py
Or install as a package:
pip install -e .
python app.py
Project layout
ImageResizer/
βββ app.py # Hugging Face Spaces entry point
βββ Template.xlsm # Workbook template (download from UI in workbook mode)
βββ image_resizer/
β βββ config.py # Constants and settings
β βββ models.py # Shared types (ImageItem, ProcessResult)
β βββ failure_log.py # Failed download logging
β βββ downloader.py # HTTP / cloudscraper / Selenium downloads
β βββ image_ops.py # Resize, format conversion, save
β βββ pipeline.py # Download + process + ZIP orchestration
β βββ workbook.py # Excel workbook parsing
β βββ processor.py # High-level processing (no UI)
β βββ ui/
β βββ theme.py # CSS and HTML assets
β βββ handlers.py # Gradio event handlers
β βββ demo.py # build_demo() β Gradio Blocks assembly
βββ requirements.txt
βββ pyproject.toml
Input modes
- Upload Workbook β Parse
.xlsx/.xlsmfiles with anItemCodecolumn and URL/image/link columns. Use Download Template beside the upload field to getTemplate.xlsmfrom the project root. - Upload Images β Process local image files or a single pasted URL
Workbook template
Place Template.xlsm at the repository root. The app serves it via the Download Template button in workbook mode. Commit this file to git so Hugging Face Spaces can serve it.
Clear Data button (Cleared Data sheet)
ClearClearedData.bas provides Clear Data for the Cleared Data worksheet (clears B2 onward; keeps row 1 and column A).
- Import
ClearClearedData.bas. - Run macro
CreateClearDataButtononce, or add a Form Control button on Cleared Data assigned toClearClearedDataSheet. - Clicking the button asks for confirmation, then clears data contents only (no row/column/format deletion).
Amazon URL auto-cleaner (Excel VBA)
AmazonUrlCleaner.bas strips Amazon image size modifiers (e.g. ._AC_SL1500_) automatically when URLs are typed or pasted.
Scope: Manual and WriteBuffer sheets only, cells from B2 onward (never row 1 or column A).
Install into Template.xlsm:
- Open the workbook β Alt+F11.
- File β Import File β select
AmazonUrlCleaner.basonly. - Open ThisWorkbook (do not import the txt file). Paste the
Workbook_SheetChangeprocedure fromAmazonUrlCleaner_ThisWorkbook.txt. - Debug β Compile VBAProject, then save as
.xlsm.
Hugging Face Spaces
This repo is configured for Hugging Face Spaces. The Space uses root app.py as the entry point.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference