We can start if you're ready.
So we go on with our next session.
So we go on with our next speaker, Michele,
who will talk to us about the FBI Improved Image Viewer.
Please welcome Michele.
Thanks.
So welcome to my talk about using the FIM Image Viewer.
Around 2006, I was a user of FBI,
the Image Viewer for the Linux Frame Buffer.
And I was fond of it, but at some point I talked,
I really need to have the VIM arrow keys into FBI.
And I made a patch to FBI.
At some point, I started realizing that I need something more,
like some shortcuts, bindings, or a small command line,
commands, at some point, a parser, auto-completion.
So, hack after hack, a fork came out of FBI,
which I called FIM.
So something which takes inspiration from the VIM text editor,
the MAT, mail user agent, and shell languages.
So what is nowadays FIM?
It's a UNIX tool.
A UNIX tool for one task.
One task which is viewing images.
It's not editing images.
So many people confound this.
It's for command line users, people who like using the keyboard.
It has a configuration file because it's nice to configure custom commands.
It uses regular expressions, standard inputs, standard outputs,
and it plays nice in scripts.
So it's highly interoperable.
The amotto is like in Perl that there is more than one way to do it.
I think FIM plays well with all the hardware.
There are functionalities for caching files or image from files
to load them in advance via prefetching, so to spare a bit of IO.
And the user interface is quite minimal,
so there are no menus, no buttons, sorry, at the moment.
And it works at the moment with four graphical output styles.
So pixels with X11, pixels with Linux frame buffer,
and ASCII art with and without color.
And it plays a bit nice under SSH or screen in different situations.
So on this picture here you see a pixel mode, character mode,
and another character mode without the colors.
So you select this when you start the program,
or you let it just being auto-detected by the environment variables.
The basic invocation of FIM is more or less like what you expect from most programs.
So you specify the files you want to open,
and in the case of graphical files,
the magic number will determine which decoder to use, not the file extension.
However, if you want to open a directory,
or recursively three of directories,
or perhaps even with a background load function,
then filtering on file names will occur.
Again, it's quite intuitive what the plus, minus, page up, page down keys do.
So it's what you expect, and this is good.
And what they do, usually it's, of course, the binding is dynamic,
so you can configure FIM to do different things.
The defaults are for plus to call the magnify command,
the internal magnify command, for minus the reduce command,
or apart from commands, you have also small actions which can be longer,
can be like a concatenation of, let's say, command argument,
or even a small control flow expression.
And yes, so it's quite rich what you can assign to single keys.
So in general, this language, which I show here in these red boxes,
it lives in the command line.
The command line which hosts this language,
which you can also access with the column key, just like in VIM.
And just like in VIM and other software, with the tab,
you might get some auto-completion of, I don't know, commands, variable names.
It's not science fiction, so it can be helpful.
Yeah, and this is the same language that you also use in the configuration files and scripts.
So that is the VIM language.
The language elements of VIM are commands, aliases, which you can customize,
variables, built-in or customizable, if while blocks,
so to have a bit of control, and some special syntax like shortcut expressions
or shortcut statements for some other precise things.
How do I use VIM?
I don't spend much time programming it or programming the usage of VIM.
Most of the time, I use it interactively as any other image viewer,
especially to organize pictures collections, like I will show later.
Occasionally, I use the special functionality.
So what is really unique to VIM or the command line?
It's quite rarely when I come up with some nice workflow which I like.
Yes, then I exchange the configuration file or even I do an alias in the shell
to reuse some special way of calling VIM, which is customized for me.
So now we will continue with this talk.
I just wanted to mention that another talk which has been recorded
will go into language-specific topics that is a bit more nerdy than this.
This talk here goes about the interactive usage of VIM.
This is not really a tutorial.
It's not a documentation.
It's a bit of a showcase, what I will be showing here.
So I said VIM is programmable, but you don't want to program it here
in what I'm showing you here, but still you want to use a bit of automation.
And the base level of automation is perhaps to simulate a key press, right?
So when you invoke VIM and specify minus K the name of a character
or of a key press, that will happen.
So you have pressed that key.
So for R, we'll rotate.
I mean, this is what will happen just after startup.
Afterwards, you are in control.
So with R, we'll rotate.
With delete, we'll delete the first image from the list.
With CH, control H, we'll make help pop up and so on.
You can go further with minus uppercase K.
So with key combos.
So if you specify minus BKRA, rotate and autoscale,
that will happen as the first thing with FIM starts once.
So afterwards, you're in control.
In VIM, I appreciate that when you are about to press a key
and you prepend it with a digit or more digits,
the number that you will have specified
also the repetition of what is about to be done.
So you have this also here.
Of course, now I'm showing you here the command line,
but this is the interactive usage.
So if you do it interactively, this is what happens.
It's the same interpreter who processes this.
Yeah, but there's also the dot modifier in VIM and also here
that instead of repeating twice a particular command,
you can add a dot after what you have just done
and it will just repeat the last action.
So plus dot, it's like plus plus.
Now, you can combine this with number syntax.
So if you prepend a number to the dot,
the dot will repeat the last command,
that number the amount of times.
This can spare you a bit of typing interactively,
but also in this special mode here.
Of course, this just applies to the last command,
not to the last combo or last series of things.
For more complicated things,
you can use another mechanism,
which is that of simply configuring your VIM RC file
and there you perhaps bind a special,
a particular keyboard key to a special command,
and then yes, you can use a repetition on that combo
which you like, which is what you use,
what is useful to you,
and that's the way to go.
So not over-complicate unnecessary things.
Now I will show random functionality which I like in VIM
but I didn't bother looking in other image viewers.
So with double apostrophe,
I have the so-called shadow directory load, let's say.
So my observation is that nowadays cameras
have a very high resolution.
I don't need that resolution.
Mostly the pictures which come from those cameras
are too heavy for my purposes.
So what I do is that I have a directory with reductions
which fit more or less my screen
and I have another directory with heavy original pictures.
But with VIM, I just say, hey VIM,
in that directory are the heavy originals.
So be aware of this.
And then VIM offers me the double apostrophe,
the double quote, key,
which does something which I forgot what it is
but you can just check it up with the help.
And that will substitute the content of the images,
of the current images with the high resolution
or low resolution or whatever you have set it up.
So it's a way to substitute it.
Probably you can use it to create funny games or whatever
but for me it's just the purpose of substituting
the low resolution image with the high resolution image
because I like using used computers.
I think there is too much garbage on this earth
and therefore sometimes I don't need that extra heavy processing
in my everyday usage.
And I think this can have many uses.
Another thing which is I think perhaps unique maybe,
it's a simple key to jump between the last view
and the current view.
Why?
Because sometimes I watch 100 pictures,
I do a selection of the few pictures I really like
and I jump between them because I want to see
certain detail from one side, from the other side.
So I like to jump a lot of times between two pictures,
perhaps to catch some detail and therefore I have this key
which most of the times I would say retains the position
you were and the scaling.
So it's really for comparing things.
I find it useful, especially in combination as I said
with the short listing functionality which allows you
to make selections to shorten the selection of pictures.
Now another random functionality is the one of conversion
pipelines.
Sometimes you want to load things which are not properly
pixel images like SVG files or PDFs or Postcript files.
There are a few built-in defaults in FIM which will invoke
that external program to convert it in something
that FIM can view.
So this enlarges the set of pictures formats
which you can watch under FIM.
Extending this idea, perhaps sometimes you want to view all
of the images which you were about to load with one specific
filter pipeline.
Here I have shown convert with charcoal filter and put a label
on the bottom.
Yeah, you can specify that to FIM when you start it.
And all of the pictures which you will see in that session
will be filtered according that way.
I don't know what this is useful for.
Previews, making fun, you choose it.
But the point is if you don't screw up this expression,
you will not write to any file.
So just temporary files will be modified.
You can interact with different programs
in different situations.
Sometimes you can use the exclamation point syntax
to call an external program and then with that external
program that gets its output.
OK, it's not that useful.
Still, if you got the danger, the dangerous way,
you are not afraid.
You create an alias which maybe calls in the end XIF tool
and you say XIF tool.
Please remove the XIF data from the file which I'm just
watching because you can specify that file as an internal
variable.
Yes, you will modify the current file which is dangerous.
You should not do it.
But if you really want and you are automating some nice
useful workflow, you can do it.
I have warned you.
OK, did you know that with FIM you can even load files
from a file name list?
OK, this sounds boring.
It sounds boring, but maybe it's nicer if you learn that
with FIM you can write files with the file name
and the description.
OK, maybe it could be even useful in a few situations.
In my case, I find it useful or I like it because FIM has
a few captions in different parts of the displayed window,
let's say.
And there are a few variables with expando codes,
so like percentage and something.
So you can customize them.
You can view, I don't know, the comment, the description
which I said before, or other information.
So you can customize it a bit the way you want it.
More, you can have in this description file internal
variables.
So just for the purpose of giving attributes to the files
you are about to have in the list.
So not only the descriptions, but also attributes.
So the bill will be in the category of businessmen.
Aron as best, Abram and Richard will be in the category
of activists.
So they will inherit this, those attributes.
Furthermore, there are some shortcut syntaxes which
prepend text to this description or allow referring
to specific variables in those descriptions for the purpose
of making them shorter.
What you can use it for apart from the caption?
Well, you can use them also for searching the picture
in the file list, in the list.
So with the go to command or you use a special slash or
question mark syntax, not command line, but search line
to search and to jump directly to a file which has a
description that way.
So if you manage your pictures collection nicely,
it can be useful.
For me, it's nice because my picture is targeted that way
and I'm happy with that.
Or I have custom collections of pictures that way
for my own amusement.
Yes.
So you have this go to command which you can use also
in other ways like jumping or controlling it to jump
according to the values of those property variables.
Or you can use this go to jump between to the next
directory, for instance.
If you load 1,000 files in different directories where
you don't know exactly where they are, you can use go to
and something very specific which you find in the
manual.
And this will jump to the next directory inside what is
being loaded there.
So there are many shortcuts, let's say, for doing very
specific jumps according to your workflow because this is
to adapt the way you wish to organize your stuff.
And of course, if you have different specifications to
the go to command, the first one which matches the jump
will do the jump.
Before the session is over, I wish to say the limit
functionality which I talk from math.
I find it also useful because you can shrink the
collection.
For instance, I have around 20,000 pictures in my
collection, in my photograph collections.
But I can limit them, for instance, to city equal
browsers or something like this which is useful to me.
In this case, you see that we have shortened the
pictures list from the file, total five to four which
matches category equal activist.
Further, the limit command can shrink the list according
to duplicate the base file names or the date of the
files or the size of the files.
The base idea of FIM is that you use it interactively.
You have a few aliases which are perhaps sometimes
customized and assigned to specific keys which you
like to have.
Yeah, and you write this in the configuration file and
you perhaps share it with others.
And you just remember by heart the commands which you
use every day.
And that's all.
So FIM at the moment will be releasing the 06 after
15 years, the 06 version.
In a few days, the table is out there.
I have to do some promotion and especially I have to
say give the next version to the Debian guys.
So there is the version on Debian and everywhere else is
old but we'll update it soon.
The manual has everything.
So everything is written there.
And I hope you enjoy FIM and perhaps watch the other
recording with more nerdy language aspects.
That's all.
Thank you for your attention.
Thank you.
So we have some time for questions.
Is there any questions on the floor?
Yeah, so the collection stuff sounds particularly
interesting.
Can you update the collection from FIM itself?
So while you're watching it, is that an image so that
while you're watching images, you update your
collection from within FIM somehow?
Perhaps at the moment I don't have this.
I'll write a text file in your...
The question was whether FIM, as I have written,
organizer, picture organizer, I wrote it correctly.
No, I wrote...it was a mistake.
FIM is not an organizer.
You have to organize the files by yourself with a text editor.
We have a non-line question here if you can read it.
Thank you for the talk.
Is there a way, plan to have a way for FIM to script a
small step-by-step animation of the actions?
Maybe some sort of slip between the actions.
Yes, there is a functionality which is called
recording out or something like this.
So after you exit FIM, on the standard out,
in a specific file, actions and commands,
sorry, and timings will be spitted out.
So there is a slip command which says slip,
I don't know, three quarters of a second,
something like this.
Yes, the answer is yes.
Question on the floor?
Yeah, good question.
What about the descriptions?
Are stored in the same image files?
Are they stored like metadata in other files?
Can they be read by exit tools?
What I have shown here was just the plain things you
write in a textual file.
Apart from this, the exit tags from JPEGs,
or I don't know, I think in other places also you
get exit data, but at least from JPEGs,
and they become internal variables in set FIM,
because I really like to have some particular JPEG
exit data being displayed in the caption,
and that occurs there.
Actually, also PNGs and also JPEGs without exit
have commands.
This also drift here.
Yeah, so there are different...
I don't think I'm covering everything, everything,
everything, but as soon as I learn of some extra
metadata, I integrate it in the internal variables
associated to each file.
I have one extra slide.
Any other question, maybe?
Okay.
Maybe I didn't have to understand so much,
but the result of modifying this file is...
Modifying which file?
The original file.
It's then storing another file.
We don't modify any file with FIM.
If you do it, this is a mistake.
Oh, okay.
There was one example where I was saying,
you can write programs to modify the file,
but most of the times you don't want this.
Okay.
But if you really want it, you can.
If the file is changed from this,
will FIM reload it automatically,
or will it...
I think there is such a functionality.
The question is, if you are stuck on a picture
and the picture changes,
will the FIM reload it?
There is some functionality to detect this.
I'm not sure if at the moment it's at default.
In principle, it's like two lines of code.
It's easy to implement this.
I think this is for picture frame situations
where many people use FIM for picture frames.
I'm not happy with that.
I wish people to use it interactively,
but yes, that's possible.
If you want, I have one extra slide.
So with FIM, you can even play the little steganographer
or the little forensic investigator
by using the offset switch
or the seek magic internal variable,
which do nothing else than saying,
hey, please, don't seek for the image at byte zero.
Seek between here and here.
The picture is there in the file.
So you can use this for looking for the signatures within the file,
which maybe is broken.
Maybe there are a few files
which are concatenated for some reasons.
Maybe it's a TAR archive, which actually...
Sorry?
I have an example of this.
So if you look at your Chrome cache,
Chrome browser, so the cache,
you have binary files,
which are a concatenation of HTTP headers
and image files.
And right now, I'm using exit two to find the byte offset
and then using image everywhere to use the file.
But I would try it being...
Yeah, so FIM is...
It's the same thing.
So the question is...
The observation is actually...
apart from maybe seeking into broken file systems that way,
you can even just look into the certain configuration files
like the cache files, like the one from the Chrome browser,
because there, actually, there are some special custom file formats
where a proper file is pushed down into another file.
Yeah, there are encodings, let's say,
which simply you have a picture,
but it cannot be immediately seen.
But with this, you can...
Functionality, which jumps or seeks,
or a file, perhaps, with a signature, can locate it.
Yeah.
Okay, last question.
We don't have any online.
Question on the floor?
Yeah?
Okay.
Okay, thank you.
Thank you.
Yeah, I need to get back.
Bye, man.