Git Product home page Git Product logo

pix-image-viewer's Introduction

Pix Image Viewer

Explore thousands of images in a zoomable and pannable grid.

Heavily inspired by Galapix but without the segfaults.

Screenshots: https://imgur.com/a/ENyh2NF

Disclaimer: This is not an official Google product.

Installing

You'll need the Rust package manager cargo which can be installed by https://rustup.rs/ or your distributions package management system.

The crate is published (occasionally) to https://crates.io/crates/pix-image-viewer and can be installed with:

cargo install pix-image-viewer

Or from github head:

cargo install --git=https://github.com/google/pix-image-viewer.git

Or from within the source directory:

cargo install --path=.

Controls

Mouse

Button Action
Left/Right Zoom in/out.
Middle Press and move to pan.

Keyboard

Key Action
Up/Down/Left/Right Move the viewport.
PageUp/PageDown Zoom in/out.
T Toggle panning mode (capture the mouse & cursor moves the viewport).
F Toggle fullscreen mode. (2023-04-29: Temporarily disabled due to piston window changes)
Shift Hold to zoom and pan in larger increments.

Limitations

  • SledDB only allows a single process to manage the database at a time. Due to this only a single instance can run at a time per database path. A simple workaround could be to use ephemeral --db_path=... locations.

Tech

  • Rust stable.
  • Sled for the image thumbnail cache.
  • Piston game framework + OpenGL.
  • Rust image decoding/resizing.

Future direction

  • Vulkan or gfx-rs? Allows more work off the render & event handling thread.
  • Efficient handling of large images? Tiling? [DONE]
  • Efficient handling of millions of small images?
  • Sort images by directory/size/time?
  • Cluster images by directory/size/time?
  • Image curation commands (delete, select, etc)?
  • Seamless image loading/fetching/thumbnailing. [DONE]
  • Command-line thumbnailing mode?
  • Push more magic numbers / consts into flags.
  • Selecting image(s).
  • Running commands on selected image(s).

And there are many TODOs in the code itself.

Developing

Please use the provided pre-commit hook to keep source code rustfmt clean and the tests passing on rust stable.

Naming conflict

I'm now aware of a naming conflict with https://github.com/linuxmint/pix so will likely be renaming the project soon. Ideas welcome!

Source Code Headers

Every file containing source code must include copyright and license information.

Apache header:

Copyright 2019 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

pix-image-viewer's People

Contributors

dependabot[bot] avatar mason-larobina avatar mucinoab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pix-image-viewer's Issues

thumbs.db is very large after browsing large directories

pix is a fun tool, but after using it to browse through a few large folders, my thumbs.db folder is 16 gigabytes. I don't see an obvious way to trigger a compaction or cleanup short of just wiping the whole thing. I think that's going to eventually become a problem ... for some, sooner rather than later. ;)

Thread 'main' panicked

Thanks for your work! For a short moment I could see some thumbs but then it crashed... :(
Running vanilla Ubuntu 20.04.1 LTS on a Geforce Laptop. Perhaps you have a quick idea what I could try to fix this.

Thanks,
Andy

RUST_BACKTRACE=1 pix
[src/database.rs:174] max_id = 139997
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/mem/mod.rs:659:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
   1: core::panicking::panic_fmt
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:50:5
   3: winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer
   4: winit::platform::platform::x11::EventsLoop::process_event
   5: winit::platform::platform::EventsLoop::poll_events
   6: glutin_window::GlutinWindow::poll_event
   7: <glutin_window::GlutinWindow as window::Window>::poll_event
   8: event_loop::Events::next
   9: <piston_window::PistonWindow<W> as core::iter::traits::iterator::Iterator>::next
  10: pix::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

skip non-image files when rendering

When passing a directory with images and other files, currently the thumbnailer will print many errors:

[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0
[2024-01-06T21:38:22Z ERROR pix::group] make_thumb: image error: 0

In the rendered grid, there are spaces left empty where these files are in the directory list. I think it would be nice to skip files that aren't renderable instead and throw a warning at most.

Also there is a warning thrown when exiting the program and I'm not sure why:

warning: queue 0x55d63d40b9d0 destroyed while proxies still attached:
  wl_shm_pool@34 still attached
  xdg_wm_base@24 still attached
  wl_output@15 still attached
  wl_output@14 still attached
  wl_seat@13 still attached
  xdg_activation_v1@12 still attached
  wp_viewporter@11 still attached
  zwp_text_input_manager_v3@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zwp_relative_pointer_manager_v1@8 still attached
  zxdg_decoration_manager_v1@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_shm@4 still attached
  wl_registry@2 still attached

Limiting memory usage?

Hi! Very interesting program - came across it after discovering Galapix, was hoping it might be a solution to exploring a collection of very large images across multiple directories - I've been looking for a nice solution to that problem for a while now.

Over the years I've saved a lot of images like the following from the National Archives site: https://catalog.archives.gov/id/18558251 When I start pix-image-viewer scanning the directories holding them, it seems to quickly max out available memory.

Is there a way to cap how much memory it's using when things are "zoomed out" and lazily load when zooming gets more aggressive?

Outdated dependencies?

Built w/rust 1.68 (after running cargo update) and now getting:

thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState<'_>` 
uninitialized, which is invalid', library/core/src/panicking.rs:123:5

Light googling suggests this is related to outdated glutin and winit. Don't have enough familiarity with the rust environment to debug myself.

broken on wayland

Fedora 31 gnome wayland on Haswell iGPU

First immediately apparent problem is full screen does not work on the secondary monitor where the window first appeared. It switches to the native (laptop) monitor (which isn't marked as primary)

Only the initial window renders correctly. When in fullscreen or attempting to resize all the added size is transparent and does not render.

Piston/PistonWindow changes broke fullscreening

In the latest update I've disabled fullscreening (the F toggle) until the root cause and code fix is pushed.

I've tried several variations of window destruction / creation and unable to determine what is causing the crash. Piston gives very little control over the glutin internals (intentionally) and the crash is coming from the creation of multiple glutin event loops.

thread 'main' panicked at 'Creating EventLoop multiple times is not supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.