Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within setup.cfg
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<a href="https://github.com/demmenie/videohash2/actions?query=workflow%3AmacOS"><img alt="Build Status" src="https://github.com/demmenie/videohash2/workflows/macOS/badge.svg"></a>
<a href="https://pypi.org/project/videohash2/"><img alt="pypi" src="https://img.shields.io/pypi/v/videohash2.svg"></a>
<a href="https://pepy.tech/project/videohash2?versions=1*&versions=2*&versions=3*"><img alt="Downloads" src="https://pepy.tech/badge/videohash2"></a>
<a href="https://github.com/demmenie/videohash2/commits/main"><img alt="GitHub lastest commit" src="https://img.shields.io/github/last-commit/demmenie/videohash2?color=blue&style=flat-square"></a>
<a href="https://github.com/demmenie/videohash2/commits/main"><img alt="GitHub latest commit" src="https://img.shields.io/github/last-commit/demmenie/videohash2?color=blue&style=flat-square"></a>
<a href="#"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/videohash2?style=flat-square"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion assets/install_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_ffmpeg_url(build=None, format=None) -> str:
if names[1]:
github_version = urllib.request.urlopen(
'https://www.gyan.dev/ffmpeg/builds/release-version').read().decode()
assert github_version, 'failed to retreive latest version from github'
assert github_version, 'failed to retrieve latest version from github'
return (
'https://github.com/GyanD/codexffmpeg/releases/download/'
f'{github_version}/ffmpeg-{github_version}-{names[1]}.{ffbuild_format}'
Expand Down
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ license_file = LICENSE
[flake8]
max-line-length = 127
extend-ignore = E203,W503

[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,*.svg
check-hidden = true
# ignore-regex =
# ignore-words-list =
8 changes: 4 additions & 4 deletions videohash2/collagemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MakeCollage:
Collage that should be as close to the shape of a square.

The images are arranged by timestamp of the frames, their
index in the image_list is based on thier timestamp on the
index in the image_list is based on their timestamp on the
video. The image with the index 2 is a frame from the 3rd
second and an index 39 is from at the 40th second. The index
is one less due to zero-based indexing.
Expand Down Expand Up @@ -116,7 +116,7 @@ def make(self) -> None:
A base image of 'collage_image_width' width and of 'number
of rows times scaled frame image height' height is created.
The base image has all pixels with RGB value 0,0,0 that is
the base image is pure black. The frame images are now embeded
the base image is pure black. The frame images are now embedded
on it.
The frame images are scaled to fit the collage base image such
that the shape of collage is as close to the shape of a square.
Expand Down Expand Up @@ -195,7 +195,7 @@ def make(self) -> None:
# for the first row the result of floor division is always zero and
# the product of 0 with scaled_frame_image_height is also zero, they
# y coordinate for the first row is 0.
# For the second row the result of floor division is one and the prodcut
# For the second row the result of floor division is one and the product
# with scaled_frame_image_height ensures that the y coordinate is
# scaled_frame_image_height below the first row.
y = (j // self.images_per_row_in_collage) * scaled_frame_image_height
Expand All @@ -214,6 +214,6 @@ def make(self) -> None:
# therefore the y coordinate stays the same for any given row.
j += 1

# save the base image with all the scaled frame images embeded on it.
# save the base image with all the scaled frame images embedded on it.
collage_image.save(self.output_path)
collage_image.close()
4 changes: 2 additions & 2 deletions videohash2/framesextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def __init__(
ffmpeg_path: Optional[str] = None,
) -> None:
"""
Raises Exeception if video_path does not exists.
Raises Exeception if output_dir does not exists or if not a directory.
Raises Exception if video_path does not exists.
Raises Exception if output_dir does not exists or if not a directory.

Checks the ffmpeg installation and the path; thus ensure that we can use it.

Expand Down
2 changes: 1 addition & 1 deletion videohash2/tilemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def save_tiles(tiles, prefix="", directory=os.getcwd(), file_format="png"):
tiles (list): List, tuple or set of :class:`Tile` objects to save.
prefix (str): Filename prefix of saved tiles.
Kwargs:
directory (str): Directory to save tiles. Created if non-existant.
directory (str): Directory to save tiles. Created if non-existent.
Returns:
Tuple of :class:`Tile` instances.
"""
Expand Down