kaspiana / mage

A command-line tool for cataloguing images (particularly digital art), styled after Git.
0 stars 0 forks source link

Show type-specific document information #48

Closed kaspiana closed 2 months ago

kaspiana commented 2 months ago

As no assumptions are made about what kind of documents will be stored in an archive, common information such as image dimensions is not currently shown.

Mage should detect the type of a file, i.e. the MIME type, and determine such information when using mage doc [doc].

Example:

document [...]
  Archive ID: [...]
  File name: [...]
  Extension: jpg
  Ingest timestamp: [...]
  Comment: <none>
  Deleted: no
  Tags: character:jade_harley

  Image / dimensions: 800x600
  Image / bit-depth: 24bit
kaspiana commented 2 months ago

This information may be stored in the database. This would allow for such information to be queried without needing to open document files.

Since documents are identified by their hash, it should not be possible for a document file to change, and so this does not introduce data redundancy.

For each relevant MIME type, a table could be created, linked to the document table with a foreign key.

Example:

image_document

document_id width height bit_depth
1 800 600 24
2 400 400 24
... ... ... ...

video_document

document_id width height bit_depth length
24 1920 1080 24 120000
... ... ... ... ...