Skip to content

Image Properties: add a Copy button to copy image info to the clipboard - #247

Merged
mtwebster merged 2 commits into
linuxmint:masterfrom
AlexB7:image-details-copy
Nov 9, 2026
Merged

mtwebster merged 2 commits into
linuxmint:masterfrom
AlexB7:image-details-copy

Conversation

@AlexB7

@AlexB7 AlexB7 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Copy button to the Image Properties dialog (between the navigation buttons and Close) that puts all the information the dialog is showing for the current image on the clipboard as plain text. This makes it easy to paste image details into a bug report, forum post, spreadsheet or notes, without selecting labels one by one.

What gets copied

  • General: Name, Width, Height, Type, Bytes, Folder
  • Metadata (only when the image has metadata and the section is shown):
    • EXIF summary: Aperture, Exposure Time, Focal Length, Flash, ISO, Metering Mode, Camera Model, Date/Time
    • XMP summary: Description, Location, Keywords, Author, Copyright
    • The full Details tree, one tag per line. Nesting is shown with leading tabs, and tag and value are separated by a tab, so the output also pastes cleanly into a spreadsheet. Categories with no data are skipped.

Empty fields are left out. Labels use the existing translated strings, so the copied text follows the UI language.

Example output:

Name: IMG_1234.jpg
Width: 4000 pixels
Height: 3000 pixels
Type: JPEG image
Bytes: 3.2 MB
Folder: Pictures

Aperture Value: f/1.8
Exposure Time: 1/120 sec.
...

Details
Camera Data
	Make	Canon
	Model	Canon EOS 80D
...

Keyboard shortcut

Ctrl+C in the dialog does the same thing. If the focused label has a text selection, Ctrl+C keeps its normal behaviour and copies only the selection.

Implementation notes

  • xviewer-image-properties-dialog.ui: new copy_button; the Close button moves from position 2 to 3.
  • xviewer-metadata-details.[ch]: new internal xviewer_metadata_details_get_text(), which walks the details GtkTreeModel recursively and returns tab-separated text.
  • xviewer-properties-dialog.c: builds the text from the dialog's labels and the details view, sets it on GDK_SELECTION_CLIPBOARD, adds a tooltip on the button, and handles Ctrl+C with a key-press-event handler.
  • The metadata labels keep the previous image's values when the current image has no metadata, so metadata is only included while metadata_box is visible.
  • All metadata code is behind the existing HAVE_METADATA / HAVE_EXIF / HAVE_EXEMPI guards, so builds without those libraries still work.

Translatable strings

  • New: Copy the image properties to the clipboard (button tooltip)
  • Reused from existing translations: _Copy, Details

Testing

  • Open Image Properties on a JPEG with EXIF data, click Copy, and paste: general, EXIF/XMP and details sections appear.
  • Repeat on an image without metadata (e.g. a PNG): only general properties are copied, with no stale values from the previous image.
  • Use Next/Previous in the dialog, then Copy: the copied text matches the image now shown.
  • Press Ctrl+C with no label selection: full properties are copied.
  • Select part of a label and press Ctrl+C: only the selection is copied.

🤖 Generated with Claude Code

AlexB7 and others added 2 commits September 30, 2026 12:51
Add a "Copy" button to the Image Properties dialog, next to "Close",
that copies everything the dialog currently shows for the selected
image to the clipboard as plain text:

- General properties: name, width, height, type, size and folder.
- EXIF and XMP summary fields, when metadata is available.
- The full metadata "Details" tree, one tag per line, with nesting
  indicated by leading tabs and tag/value separated by a tab. Empty
  categories are skipped.

Metadata is only included while the metadata section is visible, since
its labels otherwise still hold values from the previously shown image.

Ctrl+C in the dialog triggers the same copy, unless the focused label
has a text selection, in which case the normal label copy is kept.

A new internal helper, xviewer_metadata_details_get_text(), serializes
the details tree model.

Co-Authored-By: Claude Opus 5.5
- Close already uses C for its mnemonic.
- Copy doesn't belong grouped in between navigation/close buttons.
@mtwebster
mtwebster merged commit 3b79d1b into linuxmint:master Nov 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants