All Projects → pablosichert → ciid

pablosichert / ciid

Licence: MIT license
Chronological Image Identifier – Uniquely identify image files while keeping the ability to sort them chronologically by name.

Programming Languages

rust
11053 projects
shell
77523 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to ciid

pure-uuid
Pure JavaScript Based Universally Unique Identifiers (UUID)
Stars: ✭ 60 (+140%)
Mutual labels:  identifier, unique
sid
Generate Sortable Identifiers
Stars: ✭ 26 (+4%)
Mutual labels:  sortable, identifier
Dnd Kit
A modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.
Stars: ✭ 3,456 (+13724%)
Mutual labels:  sortable
CodeIgniter-Adjacency-List
Simple implementation with nestedSortable plugin.
Stars: ✭ 18 (-28%)
Mutual labels:  sortable
sandid
Every grain of sand on Earth has its own ID.
Stars: ✭ 39 (+56%)
Mutual labels:  unique
Ngx Smooth Dnd
angular wrapper for smooth-dnd
Stars: ✭ 152 (+508%)
Mutual labels:  sortable
mongoose-slug-updater
Schema-based slug plugin for Mongoose - single/compound - unique over collection/group - nested docs/arrays - relative/abs paths - sync on change: create/save/update/updateOne/updateMany/findOneAndUpdate tracked - $set operator - counter/shortId
Stars: ✭ 37 (+48%)
Mutual labels:  unique
Reactables
GigaTables is a ReactJS plug-in to help web-developers process table-data in applications and CMS, CRM, ERP or similar systems.
Stars: ✭ 112 (+348%)
Mutual labels:  sortable
dflex
The sophisticated Drag and Drop library you've been waiting for 🥳
Stars: ✭ 806 (+3124%)
Mutual labels:  sortable
kue-unique
Unique job utility for kue
Stars: ✭ 23 (-8%)
Mutual labels:  unique
dnd
Beautiful and accessible drag and drop for lists with React.
Stars: ✭ 271 (+984%)
Mutual labels:  sortable
ngx-sortable
ngx-sortable is an angular sortable list components that support drag and drop sorting
Stars: ✭ 19 (-24%)
Mutual labels:  sortable
Easy Dnd
A drag and drop implementation for Vue.js 2 https://codesandbox.io/s/easy-dnd-demo-9mbij https://codesandbox.io/s/easy-dnd-demo-2-xnqbz
Stars: ✭ 202 (+708%)
Mutual labels:  sortable
fastremap
Remap, mask, renumber, unique, and in-place transposition of 3D labeled images. Point cloud too.
Stars: ✭ 29 (+16%)
Mutual labels:  unique
Angular Skyhook
An implementation of react-dnd for Angular.
Stars: ✭ 146 (+484%)
Mutual labels:  sortable
vue-dnd-zone
vue.js plugin for drag and drop functionality
Stars: ✭ 144 (+476%)
Mutual labels:  sortable
React Smooth Dnd
react wrapper components for smooth-dnd
Stars: ✭ 1,560 (+6140%)
Mutual labels:  sortable
oc-sortablerelations-plugin
Adds drag and drop sorting functionality to the view list of the relations controller in October CMS
Stars: ✭ 16 (-36%)
Mutual labels:  sortable
zero-drag
Minimal abstraction of DOM drag-and-drop interactions
Stars: ✭ 17 (-32%)
Mutual labels:  sortable
react-table
simple react sortable searchable table
Stars: ✭ 16 (-36%)
Mutual labels:  sortable

ciid - Chronological Image Identifier

ciid is a utility to derive a chronologically sortable, unique identifier for images.

ciid build status ciid on crates.io

Usually, digital cameras and phones assign file names to images with a sequence of only 4 digits (e.g. IMG_1234.dng). Those names will easily clash for any sufficiently large amount of images.

ciid tackles this problem by deriving a hash from the image buffer. Additionally to being able to derive an identifier that is very unlikely to clash, this hash can later be used to check the integrity of the image content.

Some image processing programs update metadata of files (e.g inline JPEG- previews, tags, modified date). The resulting ciid will be unaffected from those changes, since only the actual image buffer is hashed. This has the nice side-effect that proprietary camera RAW file formats and converted .dng files will yield the same identifier most of the time.

Here's how a resulting identifier looks like:

01234567890123-a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1
└─────┬──────┘ └──────────────────────────────┬───────────────────────────────┘
  timestamp                         hash of image buffer

The first part of the identifier encodes the creation date of the image (a unix timestamp with millisecond precision), while the second part is a hash (SHA-256) based on the contents of the image buffer.

Following criteria were considered when choosing the identifier:

  • have sensible alphabetical ordering on file systems (timestamps with a higher value should appear strictly after lower ones)
  • encode information sufficiently compact
  • be safe to use in URLs

Installation (via script)

Download and run the installation script:

$ curl -s https://raw.githubusercontent.com/pablosichert/ciid/master/bin/install.sh | bash

Installation (manually)

Prerequisites

For help with installing the dependencies, have a look at the install script.

Install the ciid binary onto your system via cargo:

$ cargo install ciid

Usage

$ ciid [FLAGS] <file path>...

Flags

Short Long Description
-h  --help Prints help information
--rename-file Renames the file to the derived identifier. Preserves the file extension
-V --version  Prints version information
--verify-name Verifies if the provided file name is equal to the derived identifier

Options

Short Long Description
  --print <template> Prints provided template to stdout, substituting variables with file information. Available variables: ${file_path}, ${identifier}, ${date_time}, ${timestamp}
  --timestamp-digits <timestamp digits> Minimum number of digits the timestamp should carry. Will be padded with zeros from the left

Arguments

Name Description
<file path>... Path to image file

FAQ

Why not use a more human-readable format for the timestamp?

Why do we encode the timestamp as 01234567890123 instead of e.g. 2009-02-13 23:31:30.123? The timestamp represents an unambiguous1 single point in time, whereas the date string needs to be contextualized with a time zone. That means that you would either need to annotate the date string with a time zone or change the file name every time you are on a system which uses a different time zone.

Apart from that, the former encoding is more compact.

While unfortunately it's not easy to derive the actual date from the timestamp just by looking at it, you can compare two timestamps chronologically by sorting them by value.

1 ignoring leap-seconds.

Changelog

The changelog format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.2.0]

Changed

  • The timestamp used in the identifier is no longer a byte sequence encoded using base32. Instead, it uses the plain decimal representation of a unix timestamp with millisecond precision. The reason for this change is that the file system UI (at least on macOS) does not sort file names strictly chronologically. E.g. files with names 01, 0a, 10, a0 should preserve the order, but get presented in order 0a, 01, 10, a0.
  • The hash used in the identifier is now encoded using lowercase hex instead of base32, in accordance with how common tools encode SHA-256 hashes.

Added

  • The new CLI option --timestamp-digits can be used to control how many digits the timestamp should carry at a minimum. Missing zeros will be padded from the left.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].