Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
*.pyc
.venv
node_modules
fonts/*.ttf
*.jpg
*.jpeg
*.png
AGENTS.md
25 changes: 5 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
This is free and unencumbered software released into the public domain.
The MIT License (MIT)

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
Copyright 2024 STEVEQUINN

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

For more information, please refer to <https://unlicense.org>
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61 changes: 54 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,77 @@ Exif data can also be extracted and added to the border if the mood strikes.

A colour palette can be added to the border as well.

## Installation

```bash
git clone https://github.com/stevequinn/photoborder
```

```bash
cd photoborder
```

```bash
pip install -r requirements.txt
Comment on lines +9 to +20
```

## Usage

```bash
usage: python main.py [-h] [-e] [-p] [-t{s,m,l,p,i}] filename
usage: python main.py [-h] [-e] [-p] [-f] [-fb] [-t{s,m,l,p,i}] filename

Add a border and exif data to a jpg or png photo

positional arguments:
filename

options:
-h, --help show this help message and exit
-e, --exif print photo exif data on the border
-p, --palette Add colour palette to the photo border
-t, --border_type Border Type: p for polaroid, s for small, m for medium, l for large, i for instagram (default: s)
--include File patterns to include (default: *.jpg *.jpeg *.png, *.JPG, *.JPEG, *.PNG)
--exclude File patterns to exclude (default: *_border*)
-h, --help Show this help message and exit
-e, --exif Print photo exif data on the border
-p, --palette Add colour palette to the photo border
-t, --border_type Border Type: p for polaroid, s for small, m for medium, l for large, i for instagram (default: s)
-f, --font Font Typeface to use (default: Roboto-Regular.ttf)
-fv, --fontvariant Font style variant to use (default: 0)
-fb, --fontbold Bold Font Typeface to use (default: Roboto-Medium.ttf)
-fbv, --fontboldvariant Bold Font style variant to use (default: 0)
--include File patterns to include (default: *.jpg *.jpeg *.png, *.JPG, *.JPEG, *.PNG)
--exclude File patterns to exclude (default: *_border*)

Comment on lines 25 to +44
Made for fun and to solve a little problem.
```

---

> Note: This is a hacked together little script. Use at your own peril...

## osx_services

Adds quick actions to you OSX menu for quick deployment of tool.

## Fonts

The repo comes with [Roboto](https://fonts.google.com/specimen/Roboto) (Regular, Medium & Bold).

```photoborder/fonts```

Should you wish to use another font you should add it to the ```fonts``` directory and use the appropriate arguments

## Testing

There are some very simple tests available in the `tests/` directory.

You can run these with:

```bash
pytest -s ./tests
```

For specific test modules just do the same for the file like so:

```bash
pytest -s ./tests/test_text.py
```

## Examples

![alt text](doc/images/20241108_20241108DSCF0043_border-p_exif_palette.jpeg)
Expand Down
Loading