Options
All
  • Public
  • Public/Protected
  • All
Menu

:chocolate_bar: chocolate-bars readme

Present histograms (bars!) of images in a directory, including extras such as exif data from the camera. Star and move favorite images.

Electron based app - so, it runs on node.js.

status - stable

chocolate-bars is stable on Windows, Linux Ubuntu (Mac is possible but not tested). Releases follow semantic versioning.

Travis node

Greenkeeper badge Dependencies Dev Dependencies

npm Package NPM Downloads

styled with prettier semantic-release

License: MIT

why?

Histograms are useful for finding image defects such as:

  • over-exposure
  • under-exposure
  • low contrast

Also was curious how to implement this in node.js. And - I really miss the 'moved starred images' feature of good ole' Picasa

dependencies

  • Node 8.11.3 or higher

dependendcies for Windows

We use sharp to resize images during processing. sharp requires node-gyp to build, so you will need to install Microsoft's windows-build-tools using this command:

npm install --global --production windows-build-tools

features

  • scan a folder of images and present a browsable summary
  • show image thumbnails and histogram
  • show additional image properties such as file size, image size
  • show exif tags where available (JPEG files)
  • 'star' images in a folder like in Picasa
  • move previously 'starred' images to a new folder
  • delete the selected image
  • handles large number of images (2000+) and sub-directories, via paging
  • supports JPEG, PNG file formats
  • correctly handles JPEG image orientation (from EXIF)

usage - as cli (command line tool)

1. Install dependencies

Install:

  • Yarn
  • Node 8.3.11 (or higher)

2. Get chocolate bars (histograms) of images

Screenshot

ways to run

You can run chocolate-bars in one of two ways:

  • a) as a globally installed command line tool
  • OR b) from the source code
a) install globally as a command line tool

npm i -g electron@4

npm i -g chocolate-bars@latest --production

note: on Ubuntu you may need to prefix the above commands with sudo:

sudo npm i -g electron@4

sudo npm i -g chocolate-bars@latest --production

To use:

chocolate-bars <path to image direcory> [--subDirs]

where --subDirs means also view images in sub directories.

b) from the source code
yarn

On Windows: use a bash shell like git bash.

To test your installation:

./test.sh

To check your images:

./go.sh <path to image direcory>

example:

./go.sh ../myPhotos --subDirs

where --subDirs means also view images in sub directories.

keyboard shortcuts

A number of keyboard shortcuts are available:

Area Key Action
Images panel Up Arrow, Down Arrow Scroll up or down the set of images.
Images panel Space Scroll down the set of images.
Selected image, Expanded image* + Toggle the expanded view of the image.
Selected image, Expanded image* * or Enter Toggle the star for that image.
Expanded image* Left Arrow Show the previous image.
Expanded image* Right Arrow Show the next image.
Expanded image* Delete Prompt to delete the expanded image.
Expanded image* Escape Close the expanded image.

* An image is expanded by clicking on the small orange box in the top-right of the image.

references

image data

color spaces in image files

http://regex.info/blog/photo-tech/color-spaces-page2

online exif viewer

http://exif.regex.info/exif.cgi

electron starter

https://github.com/electron/electron-quick-start

electron and react boilerplate

https://github.com/iRath96/electron-react-typescript-boilerplate

https://github.com/electron-react-boilerplate/electron-react-boilerplate

sites

site URL
source code (github) https://github.com/mrseanryan/chocolate-bars
github page https://mrseanryan.github.io/chocolate-bars/
npm https://www.npmjs.com/package/chocolate-bars

developing code in this repository

see the contributing readme.

origin

This project is based on the excellent seeder project typescript-library-starter.

libaries

chocolate-bars uses the ExifReader library.

ORIGINAL readme (from the seeder project)

see here

authors

Original work by Sean Ryan - mr.sean.ryan(at gmail.com)

licence = MIT

This project is licensed under the MIT License - see the LICENSE file for details

Index

Type aliases

ButtonConfig

ButtonConfig: object

Type declaration

  • buttonId: string
  • dialog: object
    • buttonText: string
    • title: string
  • mode: MoveOrCopy

ChocolateBarsArgs

ChocolateBarsArgs: object

Type declaration

  • enableSubDirs: boolean
  • imageInputDir: string
  • thisScriptDir: string

ChocolateResult

ChocolateResult: object

Type declaration

Dimensions

Dimensions: object

Type declaration

  • height: number
  • width: number

DirectoryMetaData

DirectoryMetaData: object

Type declaration

  • starredImageFilenames: string[]

HistogramData

HistogramData: object

Type declaration

  • alpha: []
  • alphachannel: false
  • blue: []
  • colors: object
    • rgb: 0
    • rgba: 0
  • green: []
  • greyscale: true
  • palettes: object
    • rgb: []
    • rgba: []
  • red: []

ImageFilePath

ImageFilePath: object

Type declaration

  • originalFilepath: string
  • smallerFilepath: string

State

State: object

Type declaration

  • currentPage: number
  • enableSubDirs: boolean
  • epoch: number
  • imageInputDir: string
  • selectedImage: ImageDetail | null

Variables

Const DUMP_INDENT

DUMP_INDENT: " " = " "

Const HIDE_LOADING_AFTER_N_IMAGES

HIDE_LOADING_AFTER_N_IMAGES: 9 = 9

Const IMAGE_CONTAINER_ID

IMAGE_CONTAINER_ID: "images-wrapping-container" = "images-wrapping-container"

Const INTER_SEPARATOR

INTER_SEPARATOR: "-->" = "-->"

Const KNOWN_LATITUDE_FORMAT

KNOWN_LATITUDE_FORMAT: "North latitude" = "North latitude"

Const KNOWN_LONGITUDE_FORMAT

KNOWN_LONGITUDE_FORMAT: "East longitude" = "East longitude"

Const MAX_BYTES_TO_READ

MAX_BYTES_TO_READ: number = 128 * 1024

Const MAX_DIMENSION

MAX_DIMENSION: 800 = 800

Const argv

argv: any = require("yargs").usage("Usage: $0 <path to image directory> [--shrink] [--verbose]").demandCommand(1).argv

Const exifReader

exifReader: any = require("exifreader")

Const grid

grid: HtmlGrid = new HtmlGrid()

Const imageInputDir

imageInputDir: any = argv._[0]

Const isVerbose

isVerbose: boolean = !!argv.verbose

Let mainWindow

mainWindow: BrowserWindow | null = null

Const outputter

outputter: ConsoleOutputter = new ConsoleOutputter(isVerbose ? Verbosity.High : Verbosity.Low)

Const remote

remote: Remote = require("electron").remote

Const sharp

sharp: any = require("sharp")

Const shrink

shrink: boolean = !!argv.shrink

Const sizeOf

sizeOf: any = require("image-size")

Const subDirs

subDirs: boolean = !!argv.subDirs

Functions

createWindow

  • createWindow(): void

histogram

  • histogram(path: string, cb: function): void

launchChocolateBarsApp

  • launchChocolateBarsApp(): void

parseOrientationOrThrow

processDirectory

  • processDirectory(): void

shrinkImagesAt

  • shrinkImagesAt(): void

Object literals

Const state

state: object

currentPage

currentPage: number = 0

enableSubDirs

enableSubDirs: false = false

epoch

epoch: number = 0

imageInputDir

imageInputDir: string = ""

selectedImage

selectedImage: null = null

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc