pasteup 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. pasteup-0.3.0/.github/dependabot.yml +43 -0
  2. {pasteup-0.2.0 → pasteup-0.3.0}/.github/workflows/release.yml +7 -6
  3. {pasteup-0.2.0 → pasteup-0.3.0}/.github/workflows/tests.yml +7 -4
  4. {pasteup-0.2.0 → pasteup-0.3.0}/CHANGELOG.md +35 -1
  5. {pasteup-0.2.0 → pasteup-0.3.0}/PKG-INFO +157 -43
  6. {pasteup-0.2.0 → pasteup-0.3.0}/README.md +153 -39
  7. {pasteup-0.2.0 → pasteup-0.3.0}/pyproject.toml +5 -4
  8. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/__init__.py +1 -1
  9. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/models/schemas.py +90 -5
  10. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/routes/jobs.py +325 -146
  11. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/folder_browser.py +5 -1
  12. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/folder_scanner.py +100 -14
  13. pasteup-0.3.0/src/pasteup/services/runs.py +171 -0
  14. pasteup-0.3.0/src/pasteup/services/showcase.py +369 -0
  15. pasteup-0.3.0/src/pasteup/services/upscaler.py +234 -0
  16. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/css/styles.css +38 -0
  17. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/js/app.js +442 -55
  18. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/templates/index.html +26 -3
  19. pasteup-0.3.0/tests/test_background_runs.py +262 -0
  20. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_browse_folder_api.py +4 -0
  21. pasteup-0.3.0/tests/test_seller_folder_flow.py +299 -0
  22. pasteup-0.3.0/tests/test_showcase_sheets.py +257 -0
  23. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_ui_generation_modes.py +109 -11
  24. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_upscale_images.py +10 -10
  25. pasteup-0.3.0/tests/test_workflow_pins.py +41 -0
  26. pasteup-0.2.0/src/pasteup/services/upscaler.py +0 -152
  27. {pasteup-0.2.0 → pasteup-0.3.0}/.gitignore +0 -0
  28. {pasteup-0.2.0 → pasteup-0.3.0}/LICENSE +0 -0
  29. {pasteup-0.2.0 → pasteup-0.3.0}/SECURITY.md +0 -0
  30. {pasteup-0.2.0 → pasteup-0.3.0}/scripts/protect-repo.sh +0 -0
  31. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/__main__.py +0 -0
  32. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/cli.py +0 -0
  33. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/main.py +0 -0
  34. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/models/__init__.py +0 -0
  35. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/routes/__init__.py +0 -0
  36. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/routes/ui.py +0 -0
  37. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/__init__.py +0 -0
  38. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/cover_collage.py +0 -0
  39. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/exporter.py +0 -0
  40. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/grid_composer.py +0 -0
  41. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/image_batcher.py +0 -0
  42. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/services/video_exporter.py +0 -0
  43. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/shortcut.py +0 -0
  44. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/favicon.svg +0 -0
  45. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/fonts/OFL-Caveat.txt +0 -0
  46. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/fonts/OFL-PatrickHand.txt +0 -0
  47. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/fonts/caveat-latin-700.woff2 +0 -0
  48. {pasteup-0.2.0 → pasteup-0.3.0}/src/pasteup/static/fonts/patrick-hand-latin-400.woff2 +0 -0
  49. {pasteup-0.2.0 → pasteup-0.3.0}/tests/conftest.py +0 -0
  50. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_batch_cover_collage_api.py +0 -0
  51. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_cli.py +0 -0
  52. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_cover_collage.py +0 -0
  53. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_cover_collage_api.py +0 -0
  54. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_generate_all_folders.py +0 -0
  55. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_generate_single_folder_video_status.py +0 -0
  56. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_grid_composer.py +0 -0
  57. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_image_batcher.py +0 -0
  58. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_macos_metadata_files.py +0 -0
  59. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_page_dpi_and_geometry.py +0 -0
  60. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_partial_page_and_generation_options.py +0 -0
  61. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_request_safety.py +0 -0
  62. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_scan_folder_api.py +0 -0
  63. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_scan_selected_batch_folders.py +0 -0
  64. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_transparent_png_handling.py +0 -0
  65. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_ui_defaults.py +0 -0
  66. {pasteup-0.2.0 → pasteup-0.3.0}/tests/test_video_exporter.py +0 -0
@@ -0,0 +1,43 @@
1
+ # Version updates. Nothing else moves a pin: the workflows name each action by
2
+ # commit, and pyproject.toml pins with ~=. Each update arrives as a pull request
3
+ # that must pass ci-passed, so a breaking bump shows up as red CI rather than
4
+ # in a release.
5
+ #
6
+ # Security updates are separate (Settings > Code security) and skip the
7
+ # cooldowns below: a fix for a known vulnerability is proposed at once.
8
+ version: 2
9
+ updates:
10
+ # Every workflow in .github/workflows. Dependabot rewrites a pinned commit
11
+ # and the `# vX.Y.Z` comment beside it together.
12
+ - package-ecosystem: github-actions
13
+ directory: /
14
+ schedule:
15
+ interval: weekly
16
+ # A release must be a week old before it is proposed, so one that is pulled
17
+ # or found compromised in its first days never reaches a pull request.
18
+ cooldown:
19
+ default-days: 7
20
+ groups:
21
+ # One pull request for all of them: checkout and setup-python appear in
22
+ # both workflows, and the release-only actions move rarely.
23
+ actions:
24
+ patterns: ["*"]
25
+
26
+ # [project] dependencies and the dev extra in pyproject.toml.
27
+ - package-ecosystem: pip
28
+ directory: /
29
+ schedule:
30
+ interval: weekly
31
+ # ~= already takes bug-fix releases at install time, so propose only what a
32
+ # pin keeps out, such as a new minor of a 0.x package (fastapi 0.144).
33
+ # Stated rather than left to `auto`, which widens the range instead for
34
+ # anything it takes to be a library, keeping the old version allowed.
35
+ versioning-strategy: increase-if-necessary
36
+ cooldown:
37
+ default-days: 7
38
+ groups:
39
+ # The dev extra ships to nobody, so its tools share one pull request.
40
+ # Each runtime dependency gets its own, so a bump that breaks something
41
+ # is the only change in its pull request.
42
+ dev-tools:
43
+ patterns: ["pytest", "httpx2", "ruff"]
@@ -34,10 +34,11 @@ jobs:
34
34
  # repository's trusted publisher would then be asked to upload.
35
35
  if: github.repository == 'ftymoshchuk/pasteup'
36
36
  steps:
37
- # The releases tests.yml runs on (its v5 and v6), pinned by commit: this
38
- # runs once per release, the worst moment to meet an action's new major.
39
- - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
40
- - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
37
+ # The same commits tests.yml runs on. .github/dependabot.yml moves both
38
+ # files' pins in one pull request, so a new release of an action is met
39
+ # in CI first, not here: this runs once per release, the worst moment.
40
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
41
42
  with:
42
43
  python-version: "3.13"
43
44
 
@@ -163,7 +164,7 @@ jobs:
163
164
 
164
165
  # Pinned to the commit, not the tag: a tag can be moved by whoever owns
165
166
  # the action, and this is the one step here holding a credential.
166
- - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
167
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
167
168
 
168
169
  # An upload that succeeded is not yet a package anyone can install. Install
169
170
  # it by name from PyPI, the way a user would, and check it is this version
@@ -172,7 +173,7 @@ jobs:
172
173
  needs: publish
173
174
  runs-on: ubuntu-latest
174
175
  steps:
175
- - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
176
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
176
177
  with:
177
178
  python-version: "3.13"
178
179
 
@@ -21,9 +21,12 @@ jobs:
21
21
  # 3.11 is the floor: mullion and the app's StrEnum use need it.
22
22
  python-version: ["3.11", "3.12", "3.13"]
23
23
  steps:
24
- - uses: actions/checkout@v5
24
+ # Pinned by commit, like every action here: a tag can be moved by whoever
25
+ # owns the action. .github/dependabot.yml moves the pins, in this file and
26
+ # release.yml together.
27
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25
28
 
26
- - uses: actions/setup-python@v6
29
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
27
30
  with:
28
31
  python-version: ${{ matrix.python-version }}
29
32
  cache: pip
@@ -52,9 +55,9 @@ jobs:
52
55
  build:
53
56
  runs-on: ubuntu-latest
54
57
  steps:
55
- - uses: actions/checkout@v5
58
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56
59
 
57
- - uses: actions/setup-python@v6
60
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
58
61
  with:
59
62
  python-version: "3.13"
60
63
 
@@ -7,6 +7,39 @@ All notable changes to Pasteup are recorded here. The format follows
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.0] - 2026-11-28
11
+
12
+ ### Added
13
+ - A bundle can keep its images in format folders, such as `PNG Files` beside
14
+ `JPG Files`, as clip art is often sold. It used to fail its check with "No
15
+ supported image files were found at the top level". Sheets and covers use
16
+ its PNG folder, so each item shows once; upscaling copies each format folder
17
+ in its own format.
18
+ - **Saves to** can be changed, by typing or with a **Browse…** of its own,
19
+ instead of always being a `---Created---` folder next to the folder scanned.
20
+ The page remembers the choice for that folder. An output folder inside the
21
+ folder of bundles, such as a `-Done-` folder, is no longer listed as a
22
+ bundle.
23
+ - **Showcase** preview sheets: every image, trimmed to its content, side by
24
+ side in rows (or columns) that fill each sheet, shared evenly over the
25
+ fewest sheets that hold up to **Most images a sheet**: 14 make two sheets of
26
+ 7. Nothing is cropped, overlaps or left out. It's the app's layout from now
27
+ on; **Grid of 12** is still there. (`layout`, `images_per_page`)
28
+ - Making images for many bundles, or upscaling, now shows how far it has got:
29
+ which bundle it's on, how many are left, how many of a bundle's images are
30
+ upscaled, and how long it has taken, where it used to say only "Working…"
31
+ until the end. Reloading the page keeps showing it. If Pasteup is stopped
32
+ part way, the page says so instead of waiting forever.
33
+ (`POST /api/jobs/runs/...`, `GET /api/jobs/runs/{run_id}`)
34
+
35
+ ### Changed
36
+ - Upscaled images go straight into `PNG` and `JPG` folders inside the bundle's
37
+ output folder, without an `Upscaled` folder around them.
38
+
39
+ ### Fixed
40
+ - In **Many bundles** mode, a bundle with the same name as the output folder
41
+ was left out even when the output folder was somewhere else.
42
+
10
43
  ## [0.2.0] - 2026-10-16
11
44
 
12
45
  ### Added
@@ -54,6 +87,7 @@ The first release on PyPI.
54
87
  already running and moves to a free port when another program has 8000.
55
88
  `pasteup --shortcut` makes a double-click launcher.
56
89
 
57
- [Unreleased]: https://github.com/ftymoshchuk/pasteup/compare/v0.2.0...HEAD
90
+ [Unreleased]: https://github.com/ftymoshchuk/pasteup/compare/v0.3.0...HEAD
91
+ [0.3.0]: https://github.com/ftymoshchuk/pasteup/compare/v0.2.0...v0.3.0
58
92
  [0.2.0]: https://github.com/ftymoshchuk/pasteup/compare/v0.1.0...v0.2.0
59
93
  [0.1.0]: https://github.com/ftymoshchuk/pasteup/releases/tag/v0.1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pasteup
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Turn a folder of clip art into listing images: preview sheets, cover collages and preview videos.
5
5
  Project-URL: Source, https://github.com/ftymoshchuk/pasteup
6
6
  Project-URL: Issues, https://github.com/ftymoshchuk/pasteup/issues
@@ -22,16 +22,16 @@ Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
23
  Classifier: Topic :: Multimedia :: Graphics
24
24
  Requires-Python: >=3.11
25
- Requires-Dist: fastapi~=0.143.2
25
+ Requires-Dist: fastapi~=0.165.0
26
26
  Requires-Dist: jinja2~=3.1
27
27
  Requires-Dist: mullion~=0.2.1
28
- Requires-Dist: pillow~=12.3
28
+ Requires-Dist: pillow~=13.0
29
29
  Requires-Dist: pydantic~=2.14
30
30
  Requires-Dist: uvicorn~=0.54.0
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: httpx2~=2.13; extra == 'dev'
33
33
  Requires-Dist: pytest~=9.1; extra == 'dev'
34
- Requires-Dist: ruff==0.17.1; extra == 'dev'
34
+ Requires-Dist: ruff==0.17.6; extra == 'dev'
35
35
  Description-Content-Type: text/markdown
36
36
 
37
37
  # Pasteup
@@ -44,17 +44,20 @@ The name comes from *paste-up*, how clip art was used before desktop
44
44
  publishing: cut out by hand and pasted onto a layout board.
45
45
 
46
46
  ## What it does
47
- - **Preview sheets:** 4x3 grids of your images on a white page, as PNG or JPG
48
- at a chosen DPI.
47
+ - **Preview sheets:** every image on white pages, as PNG or JPG at a chosen
48
+ DPI: as a **showcase**, side by side in rows that fill each sheet, or in a
49
+ 4x3 grid.
49
50
  - **Cover collage:** a single page in one of three layouts, for a listing's
50
51
  main image.
51
52
  - **Preview video:** an MP4 slideshow of the sheets, exactly as long as you ask
52
53
  (Etsy's listing videos run 5 to 15 s).
53
- - **Upscaled images:** every image made 2x, 3x or 4x bigger, saved in an
54
- `Upscaled` folder as a PNG, which keeps any transparency, and a JPG on white.
54
+ - **Upscaled images:** every image made 2x, 3x or 4x bigger, in a `PNG` and a
55
+ `JPG` folder: the PNG keeps any transparency, the JPG is on white.
55
56
  - **Clean-up:** transparent PNGs land on white instead of black, phone photos
56
57
  are turned upright, and near-white backgrounds can be removed.
57
58
  - **Batch mode:** process every bundle folder under a parent folder in one go.
59
+ - **Your folders:** a bundle can keep its images loose or in format folders
60
+ such as `PNG Files` and `JPG Files`, and results can be saved anywhere.
58
61
 
59
62
  ## Install
60
63
  You need Python 3.11 or newer. Preview videos also need
@@ -133,6 +136,11 @@ files. It also builds the package, checks the README renders on PyPI and
133
136
  installs the wheel. Its `ci-passed` job succeeds only when every other job
134
137
  does, and is the one check `main` requires.
135
138
 
139
+ Every action the workflows use is pinned to a commit, and the dependencies in
140
+ `pyproject.toml` are pinned with `~=`. Once a week Dependabot proposes moving
141
+ those pins, each as a pull request that has to pass `ci-passed` like any other
142
+ (`.github/dependabot.yml`).
143
+
136
144
  `scripts/protect-repo.sh` applies the repository's branch ruleset and security
137
145
  settings through the GitHub CLI; it needs `gh` signed in as a repository admin.
138
146
 
@@ -141,7 +149,7 @@ settings through the GitHub CLI; it needs `gh` signed in as a repository admin.
141
149
  `[Unreleased]` entries in `CHANGELOG.md` under a heading for that version.
142
150
  2. Merge that through a pull request.
143
151
  3. Tag the merge commit and push the tag, e.g.
144
- `git tag v0.2.0 origin/main && git push origin v0.2.0`.
152
+ `git tag v0.3.0 origin/main && git push origin v0.3.0`.
145
153
 
146
154
  The `Release` workflow then builds the package, refuses a tag that does not
147
155
  match the built version or a changelog that does not name it, runs the test
@@ -169,7 +177,11 @@ Input scan supports the following image extensions (case-insensitive):
169
177
  - `.webp`
170
178
 
171
179
  Notes:
172
- - Folder scan is **non-recursive** (only files directly inside the selected folder).
180
+ - A scan reads the images directly inside the folder. A bundle without any
181
+ that keeps them in **format folders** instead is read from those: a folder
182
+ named for a format, such as `PNG Files`, `PNG`, `PNGs`, `JPG Files`, `JPEG`
183
+ or `jpg images`, in any case. Sheets and covers use one of them, PNG when
184
+ there is one, so each item shows once; upscaling copies all of them.
173
185
  - Hidden files, whose names start with a dot, are skipped. Most are the `._`
174
186
  files a Mac writes beside the files it copies to an exFAT or FAT32 drive or
175
187
  to some network shares: they carry the image's extension but hold no image.
@@ -194,15 +206,23 @@ Default UI values:
194
206
  - `background_tolerance`: `240`
195
207
  - `background_feather`: `1`
196
208
  - `include_partial_page`: `false`
209
+ - sheet `layout`: `showcase` in the app; `grid` for API requests that leave it
210
+ out, as before
211
+ - `images_per_page`: `12` (showcase only)
197
212
  - upscaling `scale`: `2` (also `3` or `4`)
198
213
 
199
214
  Behavior defaults:
200
215
  - Scan sample size: first `5` files (`sample_files`) in sorted order.
201
- - Images per page: `12` (fixed 4x3).
216
+ - Images per page: `12` in the grid (4x3); in a showcase, at most
217
+ `images_per_page`, shared evenly over the fewest sheets that hold them.
202
218
  - Export naming: `page_001`, `page_002`, ...
203
219
  - Export conflict handling: never overwrite existing `page_###`; continue at next index.
204
- - Upscaled images keep their image's name, in `Upscaled/PNG` and `Upscaled/JPG`,
205
- so upscaling again replaces the files the last run made.
220
+ - Upscaled images keep their image's name, in `PNG` and `JPG` folders inside
221
+ the bundle's output folder, so upscaling again replaces the files the last
222
+ run made.
223
+ - Output folder: a `---Created---` folder next to the folder scanned, unless
224
+ another is chosen in **Saves to**. The page remembers that choice for the
225
+ folder scanned.
206
226
 
207
227
  ---
208
228
 
@@ -214,7 +234,7 @@ Health check endpoint.
214
234
 
215
235
  **Response**
216
236
  ```json
217
- {"status": "ok", "app": "pasteup", "version": "0.2.0"}
237
+ {"status": "ok", "app": "pasteup", "version": "0.3.0"}
218
238
  ```
219
239
 
220
240
  ### `POST /api/jobs/scan-folder`
@@ -223,13 +243,20 @@ Validates a folder and scans for supported image files.
223
243
  **Request body**
224
244
  ```json
225
245
  {
226
- "folder_path": "/path/to/images"
246
+ "folder_path": "/path/to/images",
247
+ "output_folder_path": "/path/to/images/-Done-"
227
248
  }
228
249
  ```
250
+ - `output_folder_path` (str, optional): where results will be saved. When it
251
+ is a folder inside `folder_path`, such as a `-Done-` folder, it is left out
252
+ of `available_subfolders`: it is no bundle.
229
253
 
230
254
  **Response fields**
231
255
  - `valid` (bool): whether folder is usable and contains supported images.
232
- - `image_count` (int): number of supported files found.
256
+ - `image_count` (int): number of supported files found: those directly inside,
257
+ or else those of the bundle's PNG folder, or else its JPG folder.
258
+ - `image_folders` (list[str]): the format folders the images were found in,
259
+ such as `["PNG Files"]`; empty when they are loose in the folder.
233
260
  - `sample_files` (list[str]): up to 5 sorted sample filenames.
234
261
  - `estimated_pages` (int): `image_count // 12` (whole pages only).
235
262
  - `available_subfolders` (list): when the folder has no images of its own, the
@@ -265,6 +292,9 @@ A blank `folder_path` lists the home folder.
265
292
  Downloads and Pictures folders when it has them, and each drive on Windows.
266
293
  - `message` (str): empty unless a different folder was listed than the one
267
294
  asked for.
295
+ - `missing` (bool): `true` when the folder asked for doesn't exist, rather than
296
+ couldn't be opened. The page says nothing then when browsing for **Saves
297
+ to**, which often names a folder that isn't made yet.
268
298
 
269
299
  ### `POST /api/jobs/scan-selected-batch-folders`
270
300
  Validates selected batch subfolders under a scanned parent folder and reports which selected folders are ready for generation.
@@ -287,7 +317,8 @@ Validates selected batch subfolders under a scanned parent folder and reports wh
287
317
  - `message` (str): validation summary.
288
318
 
289
319
  ### `POST /api/jobs/generate`
290
- Used by the UI in **One bundle** mode. Scans one folder, composes pages with a fixed 4x3 layout, and exports files.
320
+ Used by the UI in **One bundle** mode. Scans one folder, composes its images
321
+ into pages in the chosen layout, and exports them.
291
322
 
292
323
  **Request body**
293
324
  ```json
@@ -304,10 +335,28 @@ Used by the UI in **One bundle** mode. Scans one folder, composes pages with a f
304
335
  "background_clean_mode": "off",
305
336
  "background_tolerance": 240,
306
337
  "background_feather": 1,
307
- "include_partial_page": false
338
+ "include_partial_page": false,
339
+ "layout": "showcase",
340
+ "images_per_page": 12
308
341
  }
309
342
  ```
310
343
 
344
+ **Layout fields** (`/generate` and `/generate-all-folders`)
345
+ - `layout` (`grid` | `showcase`, default `grid`):
346
+ - `grid`: twelve images a page, each centred in a cell of a 4x3 grid.
347
+ - `showcase`: every image, trimmed to its content (a cutout to what it
348
+ shows, an image on white to what isn't near-white), laid out in rows that
349
+ span the page's width, or in columns where pieces stack better, as a
350
+ masonry wall. The arrangement is the one that covers most of the page with
351
+ rows of even height and no piece dwarfed by the rest; images may be
352
+ reordered within a page for it, and the same images always get the same
353
+ sheet. Nothing is cropped or overlaps, and room left over is spread between
354
+ the images before it goes round the edges.
355
+ - `images_per_page` (int, 1-30, default `12`; showcase only): the most images a
356
+ sheet holds. Images are shared evenly over the fewest sheets that hold them:
357
+ 14 make two sheets of 7, not 12 and 2. Every image is placed, so
358
+ `include_partial_page` doesn't apply and `images_dropped` is `0`.
359
+
311
360
  **Output quality fields** (shared by `/generate`, `/generate-all-folders`,
312
361
  `/generate-cover-collage` and `/generate-cover-collage-batch`)
313
362
  - `page_unit` (`px` | `in` | `mm`): unit for `page_width`/`page_height`. Anything
@@ -445,11 +494,17 @@ Makes one cover per bundle folder, as `/generate-all-folders` does for sheets.
445
494
  - `message` (str)
446
495
 
447
496
  ### `POST /api/jobs/upscale-images`
448
- Makes every image of a folder bigger, saving each as a PNG and as a JPG in an
449
- `Upscaled` folder inside `output_path`: `Upscaled/PNG/<name>.png` and
450
- `Upscaled/JPG/<name>.jpg`. The PNG keeps any transparency; the JPG is
451
- flattened onto white. Images are resampled with Lanczos, which keeps edges
452
- smooth but adds no detail.
497
+ Makes every image of a bundle bigger, into a `PNG` and a `JPG` folder inside
498
+ `output_path`: `PNG/<name>.png` and `JPG/<name>.jpg`. The PNG keeps any
499
+ transparency; a JPG is on white. Images are resampled with Lanczos, which keeps
500
+ edges smooth but adds no detail.
501
+
502
+ - **Images loose in the bundle:** each saved as both a PNG and a JPG, the JPG
503
+ flattened onto white.
504
+ - **A bundle with format folders**, such as `PNG Files` and `JPG Files`: copied
505
+ folder by folder, each image in its own format. The PNG folder's images go
506
+ to `PNG`, the JPG folder's to `JPG`. A bundle with only a PNG folder gets
507
+ only PNGs.
453
508
 
454
509
  **Request body**
455
510
  ```json
@@ -464,9 +519,9 @@ smooth but adds no detail.
464
519
  - `dpi` (int, 1-1200, default `300`): stamped into every file.
465
520
  - Each file keeps its image's name, so upscaling again replaces what the last
466
521
  run made.
467
- - Files sharing a name in different formats, such as `art.png` and `art.jpg`,
468
- would be saved over each other, so one gives both formats: PNG first, then
469
- WebP, then JPG.
522
+ - Loose files sharing a name in different formats, such as `art.png` and
523
+ `art.jpg`, would be saved over each other, so one gives both formats: PNG
524
+ first, then WebP, then JPG.
470
525
  - Upscaled images are capped at 100 megapixels; an image that would pass that
471
526
  is left out and named in the response.
472
527
 
@@ -474,8 +529,11 @@ smooth but adds no detail.
474
529
  - `success` (bool): whether any image was upscaled
475
530
  - `scale` (int)
476
531
  - `total_images` (int): images upscaled
477
- - `output_path` (str): the `Upscaled` folder
478
- - `png_folder`, `jpg_folder` (str): the two folders inside it
532
+ - `own_format` (bool): `true` when the bundle has format folders, so each image
533
+ was saved only in its own format
534
+ - `output_path` (str): the output folder
535
+ - `png_folder`, `jpg_folder` (str): the two folders inside it; blank for a
536
+ format with nothing saved
479
537
  - `output_files` (list[str]): every file written
480
538
  - `images_skipped` (int): files that could not be read as images
481
539
  - `too_large_files` (list[str]): images left out for passing the cap
@@ -484,7 +542,9 @@ smooth but adds no detail.
484
542
  - `message` (str)
485
543
 
486
544
  ### `POST /api/jobs/upscale-images-batch`
487
- Upscales each selected bundle into `<created_output_root_path>/<bundle>/Upscaled`.
545
+ Upscales each selected bundle into `<created_output_root_path>/<bundle>/PNG`
546
+ and `/JPG`. The output root can sit inside the parent folder, as a `-Done-`
547
+ folder does: it is never taken for a bundle.
488
548
 
489
549
  **Request body**
490
550
  ```json
@@ -508,6 +568,47 @@ Upscales each selected bundle into `<created_output_root_path>/<bundle>/Upscaled
508
568
  `same_name_files` and `message`
509
569
  - `message` (str)
510
570
 
571
+ ### Background runs: `POST /api/jobs/runs/...`
572
+ A batch can take minutes, half an hour for many bundles upscaled 4x, and the
573
+ endpoints above answer only once it is done. These start the same job in the
574
+ background instead and answer at once, so its progress can be shown:
575
+
576
+ - `POST /api/jobs/runs/generate-all-folders`
577
+ - `POST /api/jobs/runs/generate-cover-collage-batch`
578
+ - `POST /api/jobs/runs/upscale-images-batch`
579
+ - `POST /api/jobs/runs/upscale-images` (one bundle, whose images are counted)
580
+
581
+ Each takes the same request body as the endpoint of the same name without
582
+ `/runs`, and checks it the same way first, so a bad request is still a `400`.
583
+ A good one answers `202` with the run's status. One run goes at a time: while
584
+ one does, starting another answers `409`.
585
+
586
+ ### `GET /api/jobs/runs/{run_id}`
587
+ A run's status, to ask after every second or so:
588
+ - `run_id` (str)
589
+ - `kind` (`"sheets"` | `"cover"` | `"upscale"`)
590
+ - `batch` (bool): false for one bundle
591
+ - `status` (`"running"` | `"done"` | `"failed"`)
592
+ - `bundles_total`, `bundles_done` (int)
593
+ - `bundle_number` (int | null), `bundle_name` (str | null): the bundle being
594
+ worked on, counted from 1, while the run is going
595
+ - `step` (str | null), `step_done`, `step_total` (int | null): what that
596
+ bundle is doing, such as `"Upscaling images"`, and how many of its images are
597
+ done, when they are counted
598
+ - `elapsed_seconds` (float)
599
+ - `result` (object | null): once `done`, the response the endpoint without
600
+ `/runs` would have given, with each bundle's own outcome in it
601
+ - `error` (str | null): why a `failed` run stopped
602
+
603
+ Runs are kept in memory, so they are forgotten when Pasteup stops: a run id it
604
+ doesn't know answers `404`, which means a restart stopped that run part way.
605
+ Whatever it finished by then is in the output folder.
606
+
607
+ ### `GET /api/jobs/runs/latest`
608
+ The run started last, in the same shape, or `204` with no body if nothing has
609
+ been started since Pasteup started. The page asks on loading, so a reload
610
+ during a batch goes back to showing its progress.
611
+
511
612
  ---
512
613
 
513
614
  ## Using the app
@@ -516,7 +617,11 @@ Upscales each selected bundle into `<created_output_root_path>/<bundle>/Upscaled
516
617
  bundles** (a folder with one folder inside per bundle), then click
517
618
  **Browse…**: open folders until you're in the right one, and **Use this
518
619
  folder** scans it. Or type or paste its path and click **Scan folder**.
519
- Results go in a `---Created---` folder next to it.
620
+ Results go in a `---Created---` folder next to it, unless you choose
621
+ another under **Saves to**, by typing or with its own **Browse…**. Pasteup
622
+ remembers that choice for the folder you scanned.
623
+ A bundle can keep its images loose, or in format folders such as
624
+ `PNG Files` and `JPG Files`.
520
625
  - One bundle: **Folder check** says how many images it found and how many
521
626
  full sheets of 12 they make. If the folder holds only other folders, pick
522
627
  one under **Choose folders**.
@@ -527,28 +632,36 @@ Upscales each selected bundle into `<created_output_root_path>/<bundle>/Upscaled
527
632
  alike, and DPI to upscaled images too. **Clean up white backgrounds** can
528
633
  make near-white backgrounds pure white or transparent.
529
634
  4. **Make your images.**
530
- - **Preview sheets:** every image, 12 to a page (`POST /api/jobs/generate`,
531
- or `POST /api/jobs/generate-all-folders` for many bundles), optionally with a
532
- part-filled last page and an MP4 preview video.
635
+ - **Preview sheets:** every image (`POST /api/jobs/generate`, or
636
+ `POST /api/jobs/generate-all-folders` for many bundles), as a
637
+ **Showcase**, side by side filling each sheet, up to **Most images a
638
+ sheet** on each, or in a **Grid of 12**, optionally with a part-filled
639
+ last page. Either can come with an MP4 preview video.
533
640
  - **Cover collage:** one cover in the chosen layout
534
641
  (`POST /api/jobs/generate-cover-collage`, or
535
642
  `POST /api/jobs/generate-cover-collage-batch`). **Only use certain images**
536
643
  limits it to the files you name.
537
- - **Upscaled images:** every image 2x, 3x or 4x bigger, as a PNG and a JPG
538
- in an `Upscaled` folder (`POST /api/jobs/upscale-images`, or
644
+ - **Upscaled images:** every image 2x, 3x or 4x bigger, in `PNG` and `JPG`
645
+ folders (`POST /api/jobs/upscale-images`, or
539
646
  `POST /api/jobs/upscale-images-batch`). It runs on its own, with no
540
647
  sheets or cover needed.
648
+ Making images for many bundles, or upscaling, shows which bundle it's on,
649
+ how many are left and how long it has taken. Reloading the page keeps
650
+ showing it.
541
651
  5. **Your files** lists what was made and where it was saved; **Copy** puts a
542
652
  path on the clipboard.
543
653
 
544
654
  ---
545
655
 
546
656
  ## Known Constraints
547
- - Layout is fixed to **4 columns x 3 rows** (12 images per page) only.
548
- - No custom row/column configuration in MVP.
549
- - Scan is non-recursive.
550
- - Trailing images that do not fill a complete page are left out by default; the
551
- response reports how many. Set `include_partial_page: true` to render that final
657
+ - The grid is fixed to **4 columns x 3 rows** (12 images per page).
658
+ - A showcase can't fill a page that its images' shapes don't suit, such as two
659
+ wide pieces on a square page: what's left is spread evenly rather than left
660
+ in one band.
661
+ - A scan reads a bundle's own folder and its format folders, not folders
662
+ further down.
663
+ - In the grid, trailing images that do not fill a complete page are left out by
664
+ default; the response reports how many. Set `include_partial_page: true` to render that final
552
665
  page with its unused cells left white.
553
666
  - Upscaling resamples each image: edges stay smooth, but no detail is added,
554
667
  so at 4x clip art looks soft. AI upscalers can invent detail; Pasteup has
@@ -596,8 +709,8 @@ The margin and gaps leave no room for a 4x3 grid on the page. Reduce `margin`
596
709
  or `gap`, or enlarge the page.
597
710
 
598
711
  ### Some images are missing from the output
599
- Trailing images that do not fill a complete 12-image page are left out by
600
- default. The response's `images_dropped` says how many; set
712
+ In the grid layout, trailing images that do not fill a complete 12-image page
713
+ are left out by default; a showcase places every image. The response's `images_dropped` says how many; set
601
714
  `include_partial_page: true` (in the app, tick **Include a part-filled last
602
715
  page**) to render them on a final, partly-filled page.
603
716
 
@@ -621,7 +734,8 @@ Symptoms:
621
734
  - Message: `No supported image files found (.jpg, .jpeg, .png, .webp).`
622
735
 
623
736
  Fixes:
624
- - Confirm files are directly in the selected folder (non-recursive scan).
737
+ - Confirm files are directly in the selected folder, or in format folders
738
+ inside it named like `PNG Files` or `JPG`.
625
739
  - Confirm extensions are supported.
626
740
  - Check the files aren't hidden: names starting with a dot are skipped.
627
741