feat: show image pixel dimensions in preview panel#1389
Open
Project-A-E-G-I-S wants to merge 3 commits into
Open
feat: show image pixel dimensions in preview panel#1389Project-A-E-G-I-S wants to merge 3 commits into
Project-A-E-G-I-S wants to merge 3 commits into
Conversation
added 3 commits
April 28, 2026 22:50
Adds pixel dimensions (e.g., "1920×1080") when viewing an image in the preview slideout panel. - HistoryItemDecorator.imageDimensions: computed property that reads pixel dimensions from NSBitmapImageRep, falling back to NSImage.size - Overlay on the bottom-right of the preview image with a semi-transparent black background - Metadata row displayed alongside Application, FirstCopyTime, LastCopyTime, and NumberOfCopies Closes p0deje#1139
The original implementation relied on NSImage.size, which returned nil for items stored as file URLs (e.g., Finder copies). Now reads dimensions directly from the stored image data using NSBitmapImageRep, with a fallback that reads from the file URL when the raw pasteboard data doesn'\''t contain the expected image types (.tiff, .png, .jpeg, .heic). Verified working: - Direct image copies (pasteboard has image types) - File URL copies (Finder, stored as public.file-url)
- Changed recognition level from .fast to .accurate for better text extraction - Added OCR title display as a metadata row in the preview panel (previously the OCR text was set as the item title but never visible in the UI since image items display a thumbnail instead of text)
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.
Summary
Adds pixel dimensions (e.g., "1920×1080") to image previews in the slideout panel. Displayed both as an overlay on the image and as a metadata row.
Implementation
HistoryItemDecorator.imageDimensions (Maccy/Observables/HistoryItemDecorator.swift:44-51)
NSBitmapImageRep.pixelsWide/pixelsHighNSImage.sizewhen no bitmap representation is availablePreviewItemView.swift
Localization
"ImageDimensions" = "Dimensions:"key toen.lproj/PreviewItemView.stringsCloses #1139