Code Monkey home page Code Monkey logo

photo-folder's Introduction

Photo Folder from S3

Next.JS project (+ Lambda functions to extract metadata from images) to browse and manage the files uploaded to the S3 bucket.

You will need an S3 bucket with folders of images. You can create the bucket with a serverless project in upload-handler. It will also install the lambda triggers that would run after each new uploaded image to extract metadata and store them in the .thumbnails.json file. It will also extract the thumbnail of the uploaded image and store it in the .thumbnails/ subdirectory.

S3 structure:

/
    - folder-name/
        - .thumbnails.json
        - .thumbnails/
            - IMG_20240101_101010.jpg
        - IMG_20240101_101010.jpg
        - ...more images (and more thumbnails)

I use the S3 Drive app to upload images into S3 bucket from Android phone.

Configure the AWS access to the bucket in .env file then run the Next.JS project to have an UI.

img.png

You can:

  • see image thumbnails in a grid
  • click image to see full screen view
  • use [Left] and [Right] keys to browse previous/next images
  • Press [Delete] or [X] to select images and put them into delete queue
  • Delete queue will be shown at the bottom of the screen
  • Delete image from the delete queue
  • Sort images by date/time
  • If the files have an ISO date in the name, this data will be used instead of the timestamp of modification

Thumbnails.JSON

This is an array of image information with the following properties:

[
  {
    "key": "2024 Cyprus/2024-03-30_09_41_32_411_0.jpg",
    "size": 443429,
    "modified": "2024-04-03T05:44:57.000Z",
    "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAIAAAA8r+mnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAb0lEQVR4nAFkAJv/AD5beUR6tC1pnjRtokd4qWWTxHef04av4gDk5+1zfYlFVmgZPFknVn0ZS28STHcsY48AZ2FYPjMl2se0ppeLjIV9PURMu8LIABQcADo5MrmtoIV9cq6jl97Kt+HOuv/433RlVLzBLzeAPN9GAAAAAElFTkSuQmCC",
    "metadata": {
      "width": 2400,
      "height": 1080,
      "format": "jpeg",
      "size": 443429,
      "space": "srgb",
      "channels": 3,
      "depth": "uchar",
      "density": 72,
      "chromaSubsampling": "4:2:0",
      "isProgressive": false,
      "hasProfile": true,
      "hasAlpha": false,
      "orientation": 1
    }
  }
]
  • base64 is the 8x8 image that can be used as the placeholder while the thumbnail is loading. It does not allow to distinguish what is on the photo, but gives the sense of colors of that image.

Todo

  • sort files by date
  • extract EXIF information as well

photo-folder's People

Contributors

spidgorny avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.