lglivephoto

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 9 Imported by: 0

README

LGlivephoto

Go Reference

LG smart phone is dead. Long live the Live Photo.

A Simple golang utility to unpack and pack LG Live Photo.

NOTE: this module is tested with LG G7.

Usage (binary)

For windows (x86_64) download executables below:

For other platforms, download binaries at releases section.

livephoto-unpack <livephoto image or directory which contains livephoto images>
livephoto-pack <non-livephoto image> <video to be embedded>

Usage (module)

go get -u github.com/ryanking13/lglivephoto
package main

import (
	"io/ioutil"

	"github.com/ryanking13/lglivephoto"
)

func main() {
	image, video, _ := lglivephoto.Unpack("livephoto.jpg")
	ioutil.WriteFile("livephoto_image.jpg", image, 0644)
	ioutil.WriteFile("livephoto_video.mp4", video, 0644)

	livephoto, _ := lglivephoto.Pack("livephoto_image.jpg", "livephoto_video.mp4")
	ioutil.WriteFile("livephoto_repack.jpg", livephoto, 0644)
}

See document for more information.

Documentation

Overview

Package lglivephoto provides functions to unpack or pack LG Live Photo. LG Live Photo is a functionality in LG smartphones where actions before and after taking a photo is recorded with the photo. (see: https://www.lg.com/uk/support/product-help/CT00008356-20150844039308)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(debug bool)

Debug changes logger verbosity, which is mostly used for debugging.

func IsLivePhoto

func IsLivePhoto(imagePath string) (bool, error)

IsLivePhoto checks whether given image file is a live photo or not.

func Pack

func Pack(imagePath string, videoPath string) ([]byte, error)

Pack generates LG Live Photo by embedding the mp4 video to the image,

func Unpack

func Unpack(imagePath string) ([]byte, []byte, error)

Unpack takes a Live Photo file and extracts it to image and video embedded in the photo.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL