Skip to content

eddieantonio/imgcat

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

imgcat

Build Status

It's like cat but for images.

running `imgcat cat.jpg`

Install

On macOS:

brew install eddieantonio/eddieantonio/imgcat

Important: See below if you're using iTerm2 3.0 with shell integration installed.

For other platforms, see Build.

Usage

imgcat some_image.jpg

See the manpage for more invocations.

Note on iTerm2's shell integration

If you install iTerm2's shell integration, chances are you also installed its additional scripts, including one called imgcat. iTerm's imgcat overrides this program by default. To see if this is happening to you, use which to determine where your shell is finding imgcat:

which imgcat

If it says imgcat: aliased to /Users/yourusername/.iterm2/imgcat, then you must edit your shell startup file and add unalias imgcat after the line that sources iTerm2's script. For example:

test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
unalias imgcat

Build

Clone

You must use git clone --recurse-submodules to clone this repository with its dependency, CImg:

git clone --recurse-submodules https://github.com/eddieantonio/imgcat.git

Requirements

  • libncurses5-dev
  • GNU make

Recommended dependencies

These dependencies are not necessary, but if pkg-config manages to find a compatible version on the system, imgcat will link to it!

  • libpng (any 1.x version supported by CImg)
  • libjpeg (any version supported by CImg)

Then:

./configure
make

Install

To install to /usr/local:

make install

To change the default prefix, simply provide PREFIX=... to make install:

make install PREFIX=/opt

Acknowledgements

License

Copyright © 2014–2020 Eddie Antonio Santos. Distributed under the terms of the ISC license.