picsum-photos

repository·main·Indexed 25 days ago

https://github.com/dmarby/picsum-photos

A service providing stylish placeholder images for developers. Includes the image-service for image processing, the picsum-photos CLI for service configuration and management, and the image-manifest tool for updating image dimension metadata in JSON manifests.

Tokens
512
Snippets
0
Records
8
Agent score
32%

What's inside picsum-photos

  1. Overview of Lorem Picsum

    main
    Lorem Picsum is a service that provides easy-to-use, stylish placeholder images. It is designed to function as a 'Lorem Ipsum' equivalent for visual assets, allowing developers to quickly integrate placeholder photos into their projects.
  2. Run the image-service CLI

    main

    The image-service is the primary entrypoint for the image processing service. It can be configured via command-line flags or environment variables prefixed with IMAGE_ (due to the use of envy.Parse("IMAGE")).

    To run the service, provide the required --storage-path and --hmac-key flags. The service supports both TCP (using host:port syntax) and Unix domain sockets (using a file path syntax).

  3. Configure the picsum-photos CLI

    main
    The picsum-photos application can be configured using command-line flags. These flags control network settings, service URLs, logging, database paths, and authentication. Environment variables prefixed with PICSUM_ can also be used for configuration (parsed via envy).
  4. Use the image-manifest CLI to update image dimensions

    main

    The image-manifest tool updates an existing JSON image manifest by scanning a directory of images and extracting their width and height metadata. It reads a manifest file containing a list of database.Image objects, locates the corresponding .jpg files in the specified directory, decodes their dimensions, and overwrites the manifest with the updated metadata.

    Workflow:

    1. The tool reads the manifest file specified by --image-manifest-path.
    2. For each image ID in the manifest, it looks for a file named {ID}.jpg in the directory specified by --image-path.
    3. It extracts the Width and Height from the image files.
    4. It saves the updated list back to the manifest file with indented JSON formatting.