8000 GitHub - whiter001/picview: A lightweight image viewer built with V and gg, supporting multiple formats, zoom, slideshow, and keyboard shortcuts. · GitHub
[go: up one dir, main page]

Skip to content
7FFF
whiter001Public

About

A lightweight image viewer built with V and gg, supporting multiple formats, zoom, slideshow, and keyboard shortcuts.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

picview

A lightweight image viewer built with V and gg, supporting multiple formats, zoom, slideshow, and keyboard shortcuts.

Building

Requires V. Use Git Bash on Windows.

# Verify formatting/vet/tests, then build
./build.sh

# Build to a different directory
OUT_DIR=./out ./build.sh

build.sh defaults to OUT_DIR=D:/public. That directory is already on PATH, so the resulting picview.exe can be run from anywhere without touching PATH.

Running

picview [OPTIONS] [DIR|FILE]

DIR|FILE is a directory containing images, or a single image file to start from. Defaults to the current directory.

# Pass the image directory as the first argument
picview images

# Or pass a single image file to browse its directory, starting at that file
picview images/sample.jpeg

# Or run in the current directory
picview

# Include subdirectories
picview -r images

# Print usage and exit (see Known limitations)
picview -h

# Optional fallback for compatibility
env PIC_DIR="images" picview

While developing, run straight from source instead:

v run . images

Supported Formats

  • .jpg, .jpeg, .png, .gif, .bmp, .webp

Keyboard Shortcuts

Navigation

  • Left / A - Previous image
  • Right / D - Next image
  • Up / Down - Pan view

Zoom & Fit

  • + / = - Zoom in
  • - / _ - Zoom out
  • 0 - Fit to window
  • 1 - 100% size
  • R - Refit to window
  • Drag - Move image with mouse

Slideshow

  • S - Toggle slideshow
  • [ / ] - Decrease/increase slideshow interval (seconds)

Display

  • F - Toggle fullscreen (shows status)
  • H - Show/hide help bar
  • Esc - Exit

Known limitations

  • picview -h exits without opening a window and prints nothing, whether run directly or with stdout redirected. The binary is linked with the Windows GUI subsystem (because it imports gg), so the usage text written by usage() has no console to reach. Use the in-window help bar (H) to see the key bindings instead.

Notes

  • Images are sorted naturally by filename (e.g., img2.jpg before img10.jpg)
  • Neighboring images are decoded in a background thread; recently viewed images are kept in a small GPU texture cache
  • The image cannot be dragged fully out of the window; press R or 0 to refit anyway
  • Shows: filename, resolution, index, zoom scale, fullscreen & slideshow status
  • The first command-line argument points to the image directory; the bundled samples live in images/
  • Mouse wheel also zooms the image, matching the + / - shortcuts

About

A lightweight image viewer built with V and gg, supporting multiple formats, zoom, slideshow, and keyboard shortcuts.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0