You are not logged in.

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

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
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: 200
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: 200
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: 200
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

#10 2019-11-17 11:12:21

likytau
Member
Registered: 2012-09-02
Posts: 142

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

`pix` (git version) -> crash with SIGILL

`gdb pix` ->

Program received signal SIGILL, Illegal instruction.
0x0000555555803e3c in void std::vector<unsigned long, std::allocator<unsigned long> >::_M_realloc_insert<unsigned long>(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, unsigned long&&) ()

slightly more informative, but not really clear about what point in pix is causing this.

I've tried in directories which have images at the top level, directories whose subdirectories have images, and in directories which contain ONLY images at the top level (jpg,png)
I've also tried 'pix .' and 'pix --help'; they have the same SIGILL result.

Same results with non-git version.

Possibly related:  'rocksdb' accounts for 99% of the compilation time, which seems suspect to me.

Cpu info from 'lshw', since this is a illegal instruction crash:

*-cpu
          product: Intel(R) Core(TM)2 Duo CPU     E4500  @ 2.20GHz
          vendor: Intel Corp.
          physical id: 1
          bus info: cpu@0
          size: 2200MHz
          width: 64 bits
          capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic
 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe sy
scall nx x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl cpuid aperfmper
f pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm pti dtherm cpuf
req

Just for the sake of completeness, the above `RUST_BACKTRACE=full pix` doesn't produce a backtrace either, just the same SIGILL crash

Last edited by likytau (2019-11-17 11:54:17)

Offline

#11 2019-11-26 06:50:25

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

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

Hi likytau,

I've recently committed a change which replaced rocksdb with sled (pure rust backend). If rocksdb was to blame (and that std::vector looks suspicious) then it might work now smile

Offline

#12 2019-11-27 23:34:04

likytau
Member
Registered: 2012-09-02
Posts: 142

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

I'll give it a go then.

Yes.. It looks like it works perfectly! Takes some getting used to the controls.. Currently LMB/RMB to zoom while having panning mode generally on, seems the most manageable. Operates pretty smoothly considering the age of the PC.

It's also nice to know my OpenGL isn't broken (Blender can't handle doing anything even with just a single cube without crashing, so I started to wonder...) smile

BTW, it seems that you implemented scroll wheel events, so that rolling the scroll wheel zooms in and out, but this isn't mentioned in the Readme.

Offline

#13 2019-11-27 23:47:29

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

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

Great to hear big_smile

I'll also update the readme to include that too.

What control scheme would you find more intuitive?

Offline

#14 2019-11-28 00:23:59

likytau
Member
Registered: 2012-09-02
Posts: 142

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

Well, it's expected, given I haven't used any other program like this before. Doesn't necessarily reflect on pix.

The only thing I can put my finger on is it feels like the zoom should accelerate slightly more. I'm not sure whether it accelerates currently, but I think having zoom step size gradually increase as the button remains held down, would make it a little easier to quickly get to the desired zoom.

Last edited by likytau (2019-11-28 00:24:28)

Offline

#15 2019-12-07 06:37:38

selendym
Member
Registered: 2019-09-09
Posts: 4

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

As you seem to be open to suggestions on renaming, how about "fractage" as in 'fractal' + 'montage'.
The zoom feature evokes the 'fractal feel' and, well, the view is a montage after all.

Offline

Board footer

Powered by FluxBB