Skip to content

Commit

Permalink
Reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nexy7574 committed Dec 24, 2024
1 parent 153b49a commit 064af87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/niobot/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_metadata_imagemagick(file_: pathlib.Path) -> Dict[str, Any]:
log.debug("identify output (%d): %s", result.returncode, result.stdout)
log.debug("identify took %f seconds", time.perf_counter() - start)
stdout = result.stdout
stdout = stdout[len(str(file_)) + 1:]
stdout = stdout[len(str(file_)) + 1 :]
img_format, img_width, img_height = stdout.split(",")
data = {
"streams": [
Expand Down
2 changes: 1 addition & 1 deletion src/niobot/attachments/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def from_file(
mime_type="image/webp",
size_bytes=_size(tio),
height=thumbnail_img.height,
width=thumbnail_img.width
width=thumbnail_img.width,
)
return self

Expand Down
4 changes: 1 addition & 3 deletions src/niobot/attachments/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ async def from_file(
elif isinstance(file, Path) and original_thumbnail is not False:
thumbnail_bytes = await VideoAttachment.extract_first_frame(file)
self.thumbnail = await ImageAttachment.from_file(
io.BytesIO(thumbnail_bytes),
file_name="thumbnail.webp",
thumbnail=False
io.BytesIO(thumbnail_bytes), file_name="thumbnail.webp", thumbnail=False
)
assert self.thumbnail.as_body()["info"].get("w", ...) is not None, "null width abort"
assert self.thumbnail.as_body()["info"].get("h", ...) is not None, "null height abort"
Expand Down

0 comments on commit 064af87

Please sign in to comment.