File size: 2,022 Bytes
9f718e2
9158f99
a40762d
 
 
9f718e2
a40762d
9f718e2
 
 
 
a40762d
 
 
 
 
9158f99
a40762d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: Image Rotator
emoji: 🔄
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 6.14.0
app_file: app.py
pinned: false
---

# ImageRotate


This repository contains experimental scripts and applications.

## 🔄 Image Rotator

A beautiful, premium Gradio application for rotating images by standard steps or custom angles. It supports uploading files, drag-and-drop, and pasting images directly from the clipboard.

### Features
- **Flexible Inputs**: Drag and drop, file browser, or paste directly from clipboard (Ctrl+V).
- **One-Click Presets**: Quick actions to rotate `90° CCW`, `90° CW`, or `180°`, plus a quick `Reset` button.
- **Custom Precision**: Interactive slider to rotate by any angle between `-360°` and `360°`.
- **Advanced Canvas Settings**:
  - **Expand Canvas**: Option to expand the output canvas to fit the rotated image or clip it to the original size.
  - **Custom Background Fills**: Select a transparent background (transparency layer, requires PNG export), black, white, or input a custom hex color code.
- **EXIF Correction**: Automatically respects camera orientation tags so images are rendered correctly.
- **Modern UI**: Designed using custom CSS glassmorphism, gradient banners, and a clean, responsive layout.

---

### How to Run the App

This project uses `uv` for package and environment management. Follow these guidelines to run the application:

#### 1. Setup Environment & Install Dependencies
First, ensure that `uv` is installed, then synchronize the environment.
```bash
# Sync dependencies from pyproject.toml
uv sync
```
*Note: If you are setting up the project from scratch, you can also install the dependencies manually using:*
```bash
uv add gradio pillow
```

#### 2. Launch the Application
Run the Gradio server using `uv run`. We recommend using `-u` (unbuffered) so logs flush to console immediately:
```bash
uv run python -u app.py
```

Once running, open your web browser and navigate to:
👉 **[http://127.0.0.1:7860](http://127.0.0.1:7860)**