harperreed / lrprev-extract-go

0 stars 0 forks source link

πŸ“₯ lrprev-extract-go

πŸ“ Summary of Project

lrprev-extract-go is a Go-based command-line tool designed for extracting the largest JPEG images embedded within Adobe Lightroom's .lrprev files. In addition to extracting images, the tool can also utilize Lightroom's catalog database (.lrcat) to ensure that the JPG files are stored in a structured way according to their original paths. πŸš€

This project aims to facilitate the management of your Lightroom previews and is especially useful for photographers looking to backup or organize their image assets efficiently. With simple command-line options, users can quickly extract images from directories of Lightroom previews or individual files.

βš™οΈ How to Use

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/harperreed/lrprev-extract-go.git
    cd lrprev-extract-go
  2. Compile the code:

    go build -o lrprev-extract ./cmd/lrprev-extract
  3. Install required dependencies on Linux:

    sudo apt-get install -y libgl1-mesa-dev xorg-dev

Commands

The main executable is lrprev-extract. You can invoke it from the command line with the following options:

./lrprev-extract [-d <path-to-lightroom-directory> | -f <path-to-lrprev-file>] [-o <output-directory>] [-l <path-to-lrcat>] [-include-size] [-help]

If you don't provide the required arguments, the tool will prompt you for the necessary information interactively.

Example Usage

  1. To extract images from a directory:

    ./lrprev-extract -d /path/to/lightroom -o /path/to/output
  2. To extract images from a single .lrprev file:

    ./lrprev-extract -f /path/to/file.lrprev -o /path/to/output
  3. To extract images and include size information in the filename:

    ./lrprev-extract -d /path/to/lightroom -o /path/to/output -include-size
  4. To extract images and use the Lightroom catalog for original file paths:

    ./lrprev-extract -d /path/to/lightroom -o /path/to/output -l /path/to/catalog.lrcat
  5. To use the interactive mode:

    ./lrprev-extract

    This will prompt you for the necessary information step by step.

  6. To display help information:

    ./lrprev-extract -help

πŸ› οΈ Tech Info

Directory Structure

lrprev-extract-go/
β”œβ”€β”€ README.md          # Documentation file
β”œβ”€β”€ cmd                # Command line interface code
β”‚   └── lrprev-extract # Main executable for the tool
β”‚       └── main.go    # Entry point of the application
β”œβ”€β”€ go.mod             # Go module file for dependencies
β”œβ”€β”€ internal           # Internal logic for the application
β”‚   β”œβ”€β”€ cli            # CLI interaction logic
β”‚   β”‚   └── cli.go
β”‚   β”œβ”€β”€ database       # Database interaction logic
β”‚   β”‚   └── database.go
β”‚   β”œβ”€β”€ extractor      # Extraction logic for JPEGs
β”‚   β”‚   └── extractor.go
β”‚   └── utils          # Utility functions
β”‚       └── utils.go

File Descriptions

TUI Features

The TUI (Text User Interface) has been enhanced with the following features:

Testing

The project includes unit tests for the utility functions. To run the tests, use the following command:

go test ./internal/utils

Feel free to contribute! We welcome any improvements or bug fixes. 😊


For issues and feature requests, please create an issue on the GitHub Issues Page or submit a pull request! Happy coding! πŸ’»πŸ”₯