imagepaste /

Full commit


imagepaste is a command-line utility on Haskell for sending images to image-hosting sites.


imagepaste supports image pasting sites as follows:



Building is quite simple. You will need ghc and cabal to build imagepaste. Also, make sure you already have cabal database:

$ cabal update


$ hg clone
$ cd imagepaste
$ cabal install


The only required argument is file name:

$ imp path/to/image.jpg

The program will print image link upon successful paste. You can also explicitly specify engine name:

$ imp rg path/to/image.jpg

Engine name can be incomplete but must not be ambiguous:

$ imp im image.jpg 
error: ambiguous engine name. can be: imagebin, imgur, imm


network_timeout - timeout for network operations, ms. Default value is 10000ms.

engine_auth - authentication info for engines. Specify your name and password for the account here.

try_next_engine_on_error - tells the program to try all engines if paste fails. Note that this option does not work if you specify engine name explicitly: only required engine will be tried.

engine_priority - change default internal engine priority. You can write here you favourite engine first so it will always be tried before others.

file_type_mapping - map file type to engine. Some engines allow to paste not only image files but archives, mp3s and other files too. With this option you can assign specific engine to file type.

Sample configuration:

  "network_timeout": 5000,

  "engine_auth": [{"engine": "rghost",
                   "username": "Peter",
                   "password": "D83FJ9z"},

                  {"engine": "ipicture",
                   "username": "Peter",
                   "password": "D9$ffoo"},

                  {"engine": "radikal",
                   "username": "PeterP",
                   "password": "f$90A_V38$"}

  "try_next_engine_on_error": true,

  "engine_priority": ["imagebin", "flashtux", "rghost"],

  "file_type_mapping": [{"engine": "rghost",
                         "types": [".mp3", ".ogg"]},

                        {"engine": "ompldr",
                         "types": [".rar", ".zip", ".tar.gz"]},

                        {"engine": "fastpic",
                         "types": [".jpg", ".png"]}


(c) 2010, 2011, 2012 Yuri Bochkarev