Skip to content

Commit

Permalink
Merge tag '0.3.2'
Browse files Browse the repository at this point in the history
Hollo 0.3.2
  • Loading branch information
dahlia committed Dec 18, 2024
2 parents aaa8d57 + 023c4c0 commit 261868b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 14 deletions.
19 changes: 18 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ To be released.
- The profile page now shows a user's cover image if they have one.


Version 0.3.2
-------------

Released on December 18, 2024.

- Fixed a bug where generated thumbnails had not copied the EXIF orientation
metadata from the original image. [[#76]]

- Fixed a bug where looking up remote Hubzilla actors and objects had failed.
[[#78]]

- Upgrade Fedify to 1.3.2.

[#76]: https://github.com/dahlia/hollo/issues/76
[#78]: https://github.com/dahlia/hollo/issues/78


Version 0.3.1
-------------

Expand Down Expand Up @@ -52,7 +69,7 @@ Released on December 1, 2024.

- Added pagination to the profile page. [[#40]]

- Upgrade Fedify to 1.3.0
- Upgrade Fedify to 1.3.0.

[#40]: https://github.com/dahlia/hollo/issues/40
[#59]: https://github.com/dahlia/hollo/pull/59
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@aws-sdk/client-s3": "^3.577.0",
"@aws-sdk/credential-providers": "^3.577.0",
"@aws-sdk/s3-request-presigner": "^3.577.0",
"@fedify/fedify": "^1.3.1",
"@fedify/fedify": "^1.3.2",
"@fedify/markdown-it-hashtag": "0.2.0",
"@fedify/markdown-it-mention": "^0.1.1",
"@fedify/postgres": "^0.2.1",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions src/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ export async function uploadThumbnail(
thumbnailArea = DEFAULT_THUMBNAIL_AREA,
): Promise<Thumbnail> {
const originalMetadata = await original.metadata();
const thumbnailSize = calculateThumbnailSize(
originalMetadata.width!,
originalMetadata.height!,
thumbnailArea,
);
const thumbnail = await original.resize(thumbnailSize).webp().toBuffer();
let width = originalMetadata.width!;
let height = originalMetadata.height!;
if (originalMetadata.orientation !== 1) {
// biome-ignore lint/style/noParameterAssign:
original = original.clone();
original.rotate();
if (originalMetadata.orientation !== 3) {
[width, height] = [height, width];
}
}
const thumbnailSize = calculateThumbnailSize(width, height, thumbnailArea);
const thumbnail = await original
.resize(thumbnailSize)
.webp({ nearLossless: true })
.toBuffer();
const content = new Uint8Array(thumbnail);
try {
await disk.put(`media/${id}/thumbnail.webp`, content, {
Expand Down

0 comments on commit 261868b

Please sign in to comment.