Repository navigation
Browse for folders, upscale images, and skip macOS metadata files - #9
Merged
Merged
Conversation
Browse… beside the folder field opens a dialog that lists folders through a new POST /api/jobs/browse-folder. A page can't learn the path of a folder picked with the browser's own file chooser, and Pasteup needs the path: it reads the images in place and writes ---Created--- beside them. The dialog opens at the folder in the field, so a typed path is a shortcut, else where browsing last stopped, else home. Clicking a folder opens it; the path above the list, Backspace and the shortcuts (home, Desktop, Documents, Downloads, Pictures, and each drive on Windows) move around; and the footer says how many images the folder holds, counted as the scan counts them. "Use this folder" fills the field and scans it, and in Many bundles mode checks every bundle, as Scan folder does; both now share scanFolderAndCheckBundles(). Typing a path still works. A folder that doesn't exist, or that Pasteup may not open, gives way to the nearest one above it that can be listed, with a notice saying why (and, on a Mac, where to allow access). Hidden folders and ---Created--- are left out, and links are not resolved, so ~/Dropbox stays ~/Dropbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtCFQJ6wEFf5pZSL2HSE8G
On an exFAT or FAT32 drive, or some network shares, a Mac writes a hidden "._name" file beside the files it copies there: same extension, but no image inside. The scan counted them, so a 12-image bundle scanned as 24 images, "enough for 2 full sheets"; making sheets then placed the 12 real ones and reported 12 files as unreadable. Hidden files, whose names start with a dot, are no longer images: that covers the "._" files and matches what Finder shows. One rule, is_image_file_name(), now decides for the scan, sheets, covers and the folder browser's count, so they keep agreeing. The same drives carry macOS's hidden .Spotlight-V100, .Trashes and .fseventsd folders, and unpacking a Mac-made zip anywhere else leaves a __MACOSX folder of "._" files. Batch mode offered all of these as bundles, ticked. is_ignored_folder() leaves out hidden folders, __MACOSX and ---Created--- wherever bundles are listed, in the scan and the batch endpoints alike, and covers no longer look inside them. To prune them, a cover's recursive listing moves from rglob to os.walk, which also keeps a ---Created--- inside the bundle, where an earlier cover may sit, out of the next one. Symlinked folders are still not followed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtCFQJ6wEFf5pZSL2HSE8G
A new tile in step 3, Upscaled images, runs on its own, for one bundle or for each picked bundle. Every image is made 2x, 3x or 4x bigger with Lanczos resampling and saved in an Upscaled folder inside the bundle's ---Created--- folder: Upscaled/PNG/<name>.png, which keeps any transparency, and Upscaled/JPG/<name>.jpg on white, both at the DPI from step 2. POST /api/jobs/upscale-images and /upscale-images-batch do the same through the API. Pillow premultiplies alpha as it resamples, so a cutout's edge keeps its colour instead of darkening towards the transparent pixels around it; a test fails a resize that doesn't (edge red ~130 instead of ~218). Images are read upright, as everywhere else, and an opaque one makes a PNG without an alpha channel. Files sharing a name, as art.png and art.jpg often do, would be saved over each other, so one gives both formats (PNG, then WebP, then JPG) and the other is named in the result. An image that would pass 100 megapixels once upscaled is left out before it is decoded, as pages are capped, and unreadable files are skipped; each is reported, per bundle in batch mode too. Upscaling again replaces what the last run made. PNGs are written without optimize=True, which on a 4x upscale tripled the time for a file no smaller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtCFQJ6wEFf5pZSL2HSE8G
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Browse for a folder
---Created---beside them. So the dialog lists folders through a newPOST /api/jobs/browse-folder.scanFolderAndCheckBundles(). Typing a path still works.Skip macOS metadata when scanning
._namefile beside the files it copies to an exFAT or FAT32 drive or some network shares. The scan counted them, so a 12-image bundle scanned as 24 images, and making sheets then reported 12 unreadable files. Hidden (dot) files are no longer images. One rule decides this for scans, sheets, covers and the browser's count..Spotlight-V100,.Trashes,.fseventsd) and__MACOSX, left by unpacking a Mac-made zip, are no longer offered as bundles, all ticked. Covers no longer look inside them, nor inside a---Created---within the bundle.Upscaled images
---Created---/<bundle>/Upscaled/PNG/<name>.png, keeping any transparency;---Created---/<bundle>/Upscaled/JPG/<name>.jpg, on white.art.pngandart.jpgwould be saved over each other, so one gives both formats (PNG first) and the other is named in the result.API
POST /api/jobs/browse-folder,POST /api/jobs/upscale-images,POST /api/jobs/upscale-images-batch. All documented in the README.scan-folderand generation no longer count or use hidden files. Hidden folders and__MACOSXare not detected as bundles, so the batch endpoints refuse them if selected.Testing
ruff check .;pytest(193 tests, up from 158) on Python 3.11, 3.12 and 3.13.Known gaps
System Volume Informationand$RECYCLE.BINare still offered as bundles. The browser hides them; the scan doesn't.🤖 Generated with Claude Code
https://claude.ai/code/session_01FtCFQJ6wEFf5pZSL2HSE8G
Generated by Claude Code