How kyleduo/tinypng4mac works
Tiny Image is a macOS client for compressing and converting images through TinyPNG. Users add images by dragging files into the app or invoking the Finder service; the app discovers image files, creates tasks, and submits them for compression. Results are downloaded and saved according to overwrite or Save As settings, with completed tasks available for opening or restoring. The README also documents format selection, concurrency, metadata-preservation settings, and a cached monthly usage count. Some wiring is inferred only where documented capabilities exceed the sampled source.
Main entry points: MainViewModel.swift Main view model · TPClient.swift TinyPNG client · DropFileView.swift Drag and drop · TinyPNG4MacApp.swift App and services
Components 17
Image intake
- Drag and drop
TinyPNG4Mac/TinyPNG4Mac/views/DropFileView.swift - App and services
TinyPNG4Mac/TinyPNG4Mac/TinyPNG4MacApp.swift - Image discovery
TinyPNG4Mac/TinyPNG4Mac/utils/FileUtils.swift
Task workflow
- Main view model
TinyPNG4Mac/TinyPNG4Mac/vms/MainViewModel.swift - Image task state
TinyPNG4Mac/TinyPNG4Mac/model/TaskInfo.swift - Task queue
TinyPNG4Mac/TinyPNG4Mac/client/TPQueue.swift
Compression service
- TinyPNG client
TinyPNG4Mac/TinyPNG4Mac/client/TPClient.swift - Format handling
TinyPNG4Mac/TinyPNG4Mac/model/ImageType.swift
App interface
- Main window
TinyPNG4Mac/TinyPNG4Mac/windows/MainContentView.swift - Settings window
TinyPNG4Mac/TinyPNG4Mac/windows/SettingsView.swift - Task display
TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift
Configuration
- App configuration
TinyPNG4Mac/TinyPNG4Mac/app/AppConfig.swift - Shared app context
TinyPNG4Mac/TinyPNG4Mac/app/AppContext.swift
Other components
- User
- Finder services
- TinyPNG API
- Local image files
Connections 24
- User → Drag and drop: drops images
- Drag and drop → Image discovery: discovers images
- Drag and drop → Main window: updates drop state
- Finder services → App and services: selects files
- App and services → Image discovery: discovers images
- App and services → Main view model: creates tasks
- Main window → Main view model: creates and manages
- Main view model → Image discovery: resolves paths
- Main view model → App configuration: reads settings
- Main view model → Image task state: creates tasks
- Main view model → Task queue: enqueues tasks
- Task queue → TinyPNG client: dispatches tasks
- TinyPNG client → TinyPNG API: uploads and requests
- TinyPNG client → Format handling: encodes conversion
- TinyPNG client → Local image files: reads and saves
- Local image files → TinyPNG client: supplies image data
- TinyPNG client → Image task state: updates task state
- TinyPNG client → Main view model: reports task updates
- Main view model → Task display: supplies task state
- Main view model → Main window: publishes workflow state
- User → Settings window: changes preferences
- Settings window → App configuration: stores preferences
- Shared app context → App configuration: holds configuration
- Main view model → Local image files: restores originals