Skip to content

blue0513/LGTM-Generator-from-Dropbox

Repository files navigation

LGTM-Generator from Dropbox

Generate LGTM image from your favorite images on Dropbox !

features

  • Download an image from your Dropbox.
  • Add "LGTM" on the downloaded image.
  • Many options
    • Change "LGTM" text color.
    • Select "LGTM" text color automatically.
    • Change "LGTM" text itself.
    • Set semi-transparent background under "LGTM" text.
    • Use Gif image as original one.
    • Resize the image.
    • Generate Gif image.
    • Upload the image to Gyazo.
    • Consider the usage frequency.

Notes 2018/12

--gif option has been obsoleted.
To add gif text on image, use --text-gif.

If you want to use Gif image on Dropbox, use --use-gif option.

Usage

1. Edit settings.json

Rename settings.json.sample to settings.json.

$ mv settings.json.sample settings.json
$ vi settings.json

Write your access_token of Dropbox & target directory in Dropbox.
To get access_token, you need to access Dropbox Developers page and create your app.

NOTE: The target directory is a string which starts and ends with slash, e.g. /path/to/img/

2. Execute

You can generate LGTM image as output.jpg.

$ ruby lgtm-generator-from-dropbox.rb

Advanced Usage

Change LGTM color

Use --color option

$ ruby lgtm-generator-from-dropbox.rb --color white

Select LGTM color automatically

Use --auto-color option

$ ruby lgtm-generator-from-dropbox.rb --auto-color

Change LGTM string

Use --text option

$ ruby lgtm-generator-from-dropbox.rb --text GREAT

CJK languages support

In settings.json, you should add cjk_font as the PATH of the proper font in your local machine.

For example,

{
  "cjk_font": "/Library/Fonts/ヒラギノ丸ゴ ProN W4.ttc"
}

Set semi-transparent background under LGTM string

Use --background option

$ ruby lgtm-generator-from-dropbox.rb --background

Use Gif as original image on Dropbox

Use --use-gif option
Only .gif image will be selected as the original image.

$ ruby lgtm-generator-from-dropbox.rb --use-gif

Change LGTM image size

Use --size option
--size should be like 640x480

$ ruby lgtm-generator-from-dropbox.rb --size 640x480

Generate LGTM gif

Use --text-gif option

$ ruby lgtm-generator-from-dropbox.rb --text-gif
# output.gif will be generated instead

Upload LGTM image to Gyazo

Edit gyazo_access_token in settings.json.
(You can get access_token from here by creating new app)

Then, use --upload option

$ ruby lgtm-generator-from-dropbox.rb --upload
# After uploading image, You can get the Gyazo Image URL

Consider the use of frequency

use --history option

By reading history.json automatically, the least frequently used image will be adopted as output image.

$ ruby lgtm-generator-from-dropbox.rb --history
# history.json will be created

About

Generate LGTM image from your favorite images on Dropbox !

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages