You are not logged in.

#1 2019-11-09 10:58:46

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 198
Website

pix - explore thousands of images in a zoomable, pannable grid

Hi folks, it's been a while smile

I've been hacking on a project to scratch an itch of mine: exploring thousands of dog photos. I fell in love with Galapix many months ago but found it almost unusable due to memory safety issues (segfaults and other crashes).

So I re-implemented it in Rust.

Contributions and feedback welcome!

https://github.com/google/pix-image-viewer

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

Last edited by mason.larobina (2019-11-09 11:11:01)

Offline

#2 2019-11-09 12:41:50

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 272

Re: pix - explore thousands of images in a zoomable, pannable grid

Stupid question... but what do I do with the "src" to make it useable?


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#3 2019-11-09 13:09:32

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 198
Website

Re: pix - explore thousands of images in a zoomable, pannable grid

Not stupid at all. I've just updated the docs with install instructions that probably work (but I've only tested on my machine).

I've also pushed a new version to https://crates.io/crates/pix-image-viewer so if you have rust & cargo installed (see instructions or https://rustup.rs) you can run:

cargo install pix-image-viewer

Let me know if that doesn't work and I can fix the instructions.

Enjoy!

Offline

#4 2019-11-09 13:47:08

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 272

Re: pix - explore thousands of images in a zoomable, pannable grid

I had a failure due to not having clang installed. I now get this failure however...

   Compiling pix-image-viewer v0.2.0
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/pix-image-viewer-0.2.0/src/main.rs:15:1
   |
15 | #![feature(arbitrary_self_types)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/pix-image-viewer-0.2.0/src/main.rs:17:1
   |
17 | #![feature(vec_remove_item)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/pix-image-viewer-0.2.0/src/main.rs:18:1
   |
18 | #![feature(drain_filter)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/pix-image-viewer-0.2.0/src/main.rs:19:1
   |
19 | #![feature(stmt_expr_attributes)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0554`.
error: failed to compile `pix-image-viewer v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-installZUuwfU`

Caused by:
  could not compile `pix-image-viewer`.
rustc --explain E0554
Feature attributes are only allowed on the nightly release channel. Stable or
beta compilers will not comply.

Example of erroneous code (on a stable compiler):

```
#![feature(non_ascii_idents)] // error: `#![feature]` may not be used on the
                              //        stable release channel
```

If you need the feature, make sure to use a nightly release of the compiler
(but be warned that the feature may be removed or altered in the future).

i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#5 2019-11-09 21:46:48

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 198
Website

Re: pix - explore thousands of images in a zoomable, pannable grid

Thanks, I've added clang to the install instructions.

As it turns out, all of those nightly `#![feature...]` lines are no longer used and the async stuff is now stable in rust 1.39. It builds on stable smile

Last edited by mason.larobina (2019-11-09 23:30:42)

Offline

#6 2019-11-10 12:06:04

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 272

Re: pix - explore thousands of images in a zoomable, pannable grid

Still no go I'm afraid!

$ /home/paul/.cargo/bin/pix
thread 'main' panicked at 'canonicalize: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
$ RUST_BACKTRACE=full /home/paul/.cargo/bin/pix
thread 'main' panicked at 'canonicalize: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
stack backtrace:
   0:     0x5625656af944 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h21699a12ad89cf9f
   1:     0x5625656ce07c - core::fmt::write::he12294695f2778ef
   2:     0x5625656ac8b7 - std::io::Write::write_fmt::h44777a27e04ddecd
   3:     0x5625656b1e75 - std::panicking::default_hook::{{closure}}::h7e923e764d745d9a
   4:     0x5625656b1b66 - std::panicking::default_hook::h6f2cc98a7e41cc12
   5:     0x5625656b2575 - std::panicking::rust_panic_with_hook::h41fbff0b3efc0b6b
   6:     0x5625656b2112 - std::panicking::continue_panic_fmt::h9842887ba8f35952
   7:     0x5625656b2006 - rust_begin_unwind
   8:     0x5625656ca2fa - core::panicking::panic_fmt::h60aba1c6af43ae95
   9:     0x5625656ca3f7 - core::result::unwrap_failed::h9d752befc43f45ab
  10:     0x562565105695 - pix::main::h308c33327ee9af07
  11:     0x5625650e5e93 - std::rt::lang_start::{{closure}}::hec46c2eb6716e3e7
  12:     0x5625656b1fa3 - std::panicking::try::do_call::h124c6ea999389772
  13:     0x5625656b627a - __rust_maybe_catch_panic
  14:     0x5625656b2b2d - std::rt::lang_start_internal::hb16191a81589c44a
  15:     0x5625651064b2 - main
  16:     0x7f529ca38153 - __libc_start_main
  17:     0x5625650b975e - _start
  18:                0x0 - <unknown>

i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#7 2019-11-10 13:28:17

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 198
Website

Re: pix - explore thousands of images in a zoomable, pannable grid

I was able to reproduce that by trying to open a directory with a symlink in it. I've just pushed a fix which will handle that error gracefully. Can you try again? (and thanks for your help reporting these bugs!)

Offline

#8 2019-11-10 15:50:18

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 272

Re: pix - explore thousands of images in a zoomable, pannable grid

Edit: this was from running in a dir with no images! It worked when run in a dir with images smile

--- original post ---
Well it builds now, so that's good! However, on running, the application window appears and the console is spammed with this (excerpt, as I had to ctrl-c)

[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/h is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/h is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/html is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/rs is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/markdown is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/java is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/py is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/c is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/vcxproj is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/rs is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/rs is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format could not be recognized: no extension present")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/h is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format could not be recognized: no extension present")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/sh is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/c is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/c is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/java is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/h is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/def is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/rs is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/rs is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/cc is not recognized.")
[2019-11-10T15:43:39Z ERROR pix] make_thumb: image error: UnsupportedError("Image format image/java is not recognized.")

Attempting to run a second time fails...

$ RUST_BACKTRACE=full /home/paul/.cargo/bin/pix
thread 'main' panicked at 'assertion failed: !files.is_empty()', /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/pix-image-viewer-0.2.5/src/main.rs:1057:5
stack backtrace:
   0:     0x55a110105ab4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h21699a12ad89cf9f
   1:     0x55a1101241ec - core::fmt::write::he12294695f2778ef
   2:     0x55a110102a27 - std::io::Write::write_fmt::h44777a27e04ddecd
   3:     0x55a110107fe5 - std::panicking::default_hook::{{closure}}::h7e923e764d745d9a
   4:     0x55a110107cd6 - std::panicking::default_hook::h6f2cc98a7e41cc12
   5:     0x55a1101086e5 - std::panicking::rust_panic_with_hook::h41fbff0b3efc0b6b
   6:     0x55a10fb3c1b5 - std::panicking::begin_panic::h22e0da755ff50819
   7:     0x55a10fb5b8f1 - pix::main::h4748cf0c34a772eb
   8:     0x55a10fb3be83 - std::rt::lang_start::{{closure}}::habd216bfbc4df514
   9:     0x55a110108113 - std::panicking::try::do_call::h124c6ea999389772
  10:     0x55a11010c3ea - __rust_maybe_catch_panic
  11:     0x55a110108c9d - std::rt::lang_start_internal::hb16191a81589c44a
  12:     0x55a10fb5c622 - main
  13:     0x7fb94d882153 - __libc_start_main
  14:     0x55a10fb0f75e - _start
  15:                0x0 - <unknown>

Last edited by fabertawe (2019-11-10 17:14:03)


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

#9 2019-11-10 17:11:13

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 272

Re: pix - explore thousands of images in a zoomable, pannable grid

Pix a great idea and I could find it very useful to use from my file manager (SpaceFM), possibly with some "enhancements" (from my perspective, obviously)...

Could some sort of "user commands" be implemented, to act on the pictures? For instance, Mirage (image viewer) has a "custom actions" menu. So I assign a custom action such as "Open in GIMP" -> "gimp %F". MIrage has a number of parameters, of which %F is "file path, name and extension". A key shortcut can be applied to each action also. With a key shortcut you wouldn't even need a right-click context menu, just apply to the image under the pointer (shift-click and ctrl-click could also be used for a selection). "Delete" would be handy too.

Apologies for rambling, this sort of thing may be far more than you ever intended to implement. Thanks anyway smile

Last edited by fabertawe (2019-11-10 17:12:50)


i7 4790K 4.4GHz, ASRock Z97 Extreme6, 16GB 2400MHz, GTX 970, Arch x86_64

Offline

Board footer

Powered by FluxBB